FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-125028: Prohibit placeholders in partial keywords by dg-pb · Pull Request #125197 · python/cpython · GitHub

/ cpython Public

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

Closed
dg-pb wants to merge 3 commits into
python:mainfrom
dg-pb:gh-125028-prohibit-kw-placeholders
Closed

gh-125028: Prohibit placeholders in partial keywords#125197
dg-pb wants to merge 3 commits into
python:mainfrom
dg-pb:gh-125028-prohibit-kw-placeholders

Conversation

dg-pb commented Oct 9, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

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 commented Oct 26, 2024

Copy link
Copy Markdown
Contributor Author

Not planned.

dg-pb closed this Oct 26, 2024
dg-pb deleted the gh-125028-prohibit-kw-placeholders branch October 26, 2024 04:34
dg-pb restored the gh-125028-prohibit-kw-placeholders branch October 27, 2024 00:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL