Skip to content

gh-125028: Prohibit placeholders in partial keywords - #126062

Merged
serhiy-storchaka merged 16 commits into
python:mainfrom
dg-pb:gh-125028-prohibit-kw-placeholders
May 8, 2025
Merged

gh-125028: Prohibit placeholders in partial keywords#126062
serhiy-storchaka merged 16 commits into
python:mainfrom
dg-pb:gh-125028-prohibit-kw-placeholders

Conversation

@dg-pb

@dg-pbdg-pb commented Oct 28, 2024

Copy link
Copy Markdown
Contributor

Comment threadLib/functools.py Outdated
Comment threadModules/_functoolsmodule.c Outdated
@dg-pb
dg-pb marked this pull request as draft October 30, 2024 08:59
@dg-pb
dg-pb marked this pull request as ready for review October 30, 2024 10:16
Comment threadModules/_functoolsmodule.c Outdated
Comment threadModules/_functoolsmodule.c Outdated
Comment threadModules/_functoolsmodule.c Outdated
dg-pband others added 2 commits January 5, 2025 10:03
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Comment threadLib/test/test_functools.py Outdated
Comment threadModules/_functoolsmodule.c Outdated
dg-pband others added 2 commits January 5, 2025 14:56
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

@erlend-aaslanderlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please amend Doc/library/functools.rst and Doc/whatsnew/3.14.rst as needed.

@bedevere-app

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@dg-pb

dg-pb commented Jan 5, 2025

Copy link
Copy Markdown
ContributorAuthor

I have made the requested changes; please review again

@bedevere-app

Copy link
Copy Markdown

Thanks for making the requested changes!

@erlend-aasland: please review the changes made to this pull request.

@erlend-aasland

Copy link
Copy Markdown
Contributor

Thanks, looks good to me. I'd like Serhiy's eyes on it also.

Comment threadLib/test/test_functools.py
Comment threadLib/functools.py Outdated
Comment threadModules/_functoolsmodule.c
Comment threadModules/_functoolsmodule.c Outdated

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment threadLib/test/test_functools.py Outdated
Comment threadLib/test/test_functools.py Outdated
Comment threadLib/test/test_functools.py Outdated
@dg-pb

dg-pb commented May 8, 2025

Copy link
Copy Markdown
ContributorAuthor

@rhettinger, @serhiy-storchaka
This is API adjustment for new feature, thus I think it would be good to merge this before 3.14 release. Given it is a fairly small one, maybe it would be good to get it out of the way sooner than later?


Also, what are your thoughts on:

  1. gh-119109: improve functools.partial vectorcall with keywords #124584 - in addition to intended improvements this one solves current free-threading issue (the last one in that series) - Race between partial_vectorcall_fallback and _PyVectorcall_FunctionInline under free-threading #128050
  2. gh-124652: partialmethod simplifications #124788 - this one would simplify some complexity in inspect and make partialmethod a bit more performant

Should either of the above be aimed to be merged before 3.14 or is it not of importance?

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

It should go in 3.14, no question. It is much easier to prohibit this in 3.14, that in any following version, when we would need to pass through a deprecation process. On other hand, we can allow Placeholder as a keyword argument at any time if it is needed.

@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@serhiy-storchaka
serhiy-storchaka merged commit afed5f8 into python:mainMay 8, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @dg-pb for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2025
…126062)
(cherry picked from commit afed5f8)
Co-authored-by: dgpb <3577712+dg-pb@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-133645 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label May 8, 2025
serhiy-storchaka pushed a commit that referenced this pull request May 8, 2025
… (GH-133645)
(cherry picked from commit afed5f8)
Co-authored-by: dgpb <3577712+dg-pb@users.noreply.github.com>
@dg-pb
dg-pb deleted the gh-125028-prohibit-kw-placeholders branch May 8, 2025 11:57
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dg-pb@erlend-aasland@serhiy-storchaka@zhangyx1998