Skip to content
New issue

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

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

Already on GitHub? # to your account

allow **kwargs to take arguments which conflict with positional-only parameters #2800

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

davidhewitt
Copy link
Member

@davidhewitt davidhewitt commented Dec 8, 2022

Closes #2799

I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out handle_kwargs method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new extract_argument.rs.)

@davidhewitt davidhewitt force-pushed the positional-only-kwarg branch from f2cea0f to e3bfc45 Compare December 9, 2022 14:49
@davidhewitt
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Dec 14, 2022
2800: allow `**kwargs` to take arguments which conflict with positional-only parameters r=davidhewitt a=davidhewitt

Closes #2799 

I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out `handle_kwargs` method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new `extract_argument.rs`.)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Dec 14, 2022

Build failed:

@davidhewitt davidhewitt force-pushed the positional-only-kwarg branch from e3bfc45 to e8e02f0 Compare December 15, 2022 04:25
@davidhewitt
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Dec 15, 2022
2800: allow `**kwargs` to take arguments which conflict with positional-only parameters r=davidhewitt a=davidhewitt

Closes #2799 

I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out `handle_kwargs` method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new `extract_argument.rs`.)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Dec 15, 2022

Build failed:

@davidhewitt davidhewitt force-pushed the positional-only-kwarg branch from e8e02f0 to 33871b7 Compare December 17, 2022 07:22
@davidhewitt
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Dec 17, 2022
2709: ci: add Python 3.12-dev jobs r=davidhewitt a=davidhewitt

Separately to #2708, time to start testing 3.12 alphas on CI. I imagine this might also take a while for the packages to come available.

2800: allow `**kwargs` to take arguments which conflict with positional-only parameters r=davidhewitt a=davidhewitt

Closes #2799 

I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out `handle_kwargs` method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new `extract_argument.rs`.)

2811: adjust vectorcall symbols for pypy r=davidhewitt a=davidhewitt

Closes #2738

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Dec 17, 2022

Build failed (retrying...):

bors bot added a commit that referenced this pull request Dec 17, 2022
2800: allow `**kwargs` to take arguments which conflict with positional-only parameters r=davidhewitt a=davidhewitt

Closes #2799 

I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out `handle_kwargs` method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new `extract_argument.rs`.)

2811: adjust vectorcall symbols for pypy r=davidhewitt a=davidhewitt

Closes #2738

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Dec 17, 2022

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented Dec 17, 2022

Build succeeded:

@bors bors bot merged commit 239f8e6 into PyO3:main Dec 17, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Positional-only parameters do not follow PEP 570
2 participants