8000 gh-124652: partialmethod simplifications by dg-pb · Pull Request #124788 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124652: partialmethod simplifications #124788

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Merge remote-tracking branch 'upstream/main' into gh-124652-partialme…
…thod
  • Loading branch information
dg-pb committed May 8, 2025
commit ec641378a3371a14e9385426e249e74448d0ca1b
3 changes: 3 additions & 0 deletions Lib/functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ def __new__(cls, func, /, *args, **keywords):
raise TypeError("the first argument must be callable")
if args and args[-1] is Placeholder:
raise TypeError("trailing Placeholders are not allowed")
for value in keywords.values():
if value is Placeholder:
raise TypeError("Placeholder cannot be passed as a keyword argument")
if isinstance(func, partial):
pto_phcount = func._phcount
tot_args = func.args
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0