Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument Clinic: add support for deprecating keyword use of parameters #107704

Closed
erlend-aasland opened this issue Aug 7, 2023 · 3 comments
Closed
Labels
topic-argument-clinic type-feature A feature request or enhancement

Comments

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Aug 7, 2023

See #95065 (comment) by Serhiy. Quoting:

Turn positional-or-keyword parameters into positional-only parameters. A directive which means "the preceding positional-or-keyword parameters will be positional-only parameters in future".

In #95151, Argument Clinic learned how to deprecate positional use of parameters. In this issue, we propose to teach Argument Clinic how to deprecate keyword use of parameters.

Suggesting to use a similar syntax as the one introduced in #95151

func
   a: object
   / [from X.Y]

Meaning a will be positional-only from Python version X.Y. We can reuse parts of the code introduced in #95151 to implement this feature.

Linked PRs

@erlend-aasland erlend-aasland added type-feature A feature request or enhancement topic-argument-clinic labels Aug 7, 2023
@erlend-aasland
Copy link
Contributor Author

cc. @serhiy-storchaka

@serhiy-storchaka
Copy link
Member

I am working on this.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Aug 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Aug 15, 2023
… use of parameters

It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Aug 15, 2023
… use of parameters

It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")
serhiy-storchaka added a commit that referenced this issue Aug 19, 2023
…f parameters (GH-107984)

It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")

Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Aug 19, 2023
serhiy-storchaka added a commit that referenced this issue Aug 21, 2023
@erlend-aasland
Copy link
Contributor Author

Thanks for doing this, Serhiy.

AA-Turner pushed a commit to AA-Turner/devguide that referenced this issue Sep 26, 2023
…eyword use of parameters (python/cpython#107984)

It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")

Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
erlend-aasland added a commit to python/devguide that referenced this issue Oct 1, 2023
…eyword use of parameters (python/cpython#107984)

It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")

Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-argument-clinic type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants