8000 gh-125028: Prohibit placeholders in partial keywords by dg-pb · Pull Request #125197 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-125028: Prohibit placeholders in partial keywords #125197

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

Closed
wants to merge 3 commits into from

Conversation

dg-pb
Copy link
Contributor
@dg-pb dg-pb commented Oct 9, 2024

Slight initialization penalty for vanilla case, but slightly faster for subclass optimization.

Bench

S="
from functools import partial, Placeholder
f = lambda a, b: None
p = partial(f, a=1)
"
C0='partial(f, a=1)'
C1='partial(p, b=2)'
                            # BEFORE | AFTER
$PYEXE -m timeit -s $S $C0  # 180 ns | 210 ns
$PYEXE -m timeit -s $S $C1  # 280 ns | 250 ns

@dg-pb
Copy link
Contributor Author
dg-pb commented Oct 26, 2024

Not planned.

@dg-pb dg-pb closed this Oct 26, 2024
@dg-pb dg-pb deleted the gh-125028-prohibit-kw-placeholders branch October 26, 2024 04:34
@dg-pb dg-pb restored the gh-125028-prohibit-kw-placeholders branch October 27, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0