Uh oh!
There was an error while loading. Please reload this page.
gh-125916: Adapt functools.reduce() to Argument Clinic - #125999
Conversation
skirpichev
commented
Oct 26, 2024
This coming from #125917. Red alert: to make AC happy, docstring was adjusted. I did some benchmarks. Details# a.pyimportpyperffromfunctoolsimportreducef=lambdax, y: x+ylst=list(range(5))
init=123runner=pyperf.Runner()
runner.bench_func('reduce(f, lst)', reduce, f, lst)
runner.bench_func('reduce(f, lst, init)', reduce, f, lst, init)Run e.g. with: with results:
So, at least AC-backed argument processing offer some speedup. |
erlend-aasland
commented
Oct 26, 2024
Thanks Sergey, I'll review this within today. Ping me tomorrow if I forget. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
PEP 257 says that "Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description." This is also a requirement from the Argument Clinic.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Yak-shave in preparation for Argument Clinic adaption in pythongh-125999. (cherry picked from commit 9b14083) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Yak-shave in preparation for Argument Clinic adaption in pythongh-125999. (cherry picked from commit 9b14083) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
erlend-aasland
commented
Oct 29, 2024
I'll give Jelle and Serhiy a chance to chime in again before landing this. |
erlend-aasland
commented
Nov 1, 2024
I plan to land this later today (post noon ET). |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
erlend-aasland
commented
Nov 1, 2024
Thanks for the PR, Sergey; thanks for the reviews, Jelle and Serhiy. |
Yak-shave in preparation for Argument Clinic adaption in pythongh-125999.
Yak-shave in preparation for Argument Clinic adaption in pythongh-125999.
functools.reduces 'initial' to be a keyword argument #125916