Repository navigation
Conversation
`@vectorcall` accepted `*args`, but the generated code expected an args tuple. Use fastcall form to parse the args array. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zip had no vectorcall, so every call built an args tuple and a kwargs
dict, and strict=True also went through PyArg_ParseTupleAndKeywords with
a temporary empty tuple. Argument error messages are unchanged except
for unknown keywords: `zip(strict=1, x=2)` now reports "got an
unexpected keyword argument 'x'" instead of "takes at most 1 keyword
argument (2 given)". The docstring gains a summary line;
`__text_signature__` is unchanged.
pyperf microbenchmark (PGO+LTO, run serially):
| Benchmark | base | zip |
|------------------------|:-------:|:---------------------:|
| zip(a, b, strict=True) | 118 ns | 61.5 ns: 1.92x faster |
| zip(a, b) | 64.9 ns | 53.1 ns: 1.22x faster |
| zip(a) | 55.0 ns | 47.1 ns: 1.17x faster |
| list(zip(a, b)) | 123 ns | 113 ns: 1.09x faster |
| zip() | 27.4 ns | 25.7 ns: 1.07x faster |
| Sub(a, b) | 71.5 ns | 70.6 ns: 1.01x faster |
Benchmark hidden because not significant (1): zip.`__new__`
Benchmark code:
```python
import pyperf
runner = pyperf.Runner()
setup = "a = (1, 2, 3); b = [4, 5, 6]"
for stmt in ["zip()", "zip(a)", "zip(a, b)", "zip(a, b, strict=True)",
"list(zip(a, b))"]:
runner.timeit(stmt, stmt, setup)
runner.timeit('zip.`__new__`', 'new(zip, a, b)', setup + '; new = zip.__new__')
runner.timeit('Sub(a, b)', 'S(a, b)', setup + '\nclass S(zip): pass')
```
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmaloney
requested review from
AA-Turner,
ericsnowcurrently and
erlend-aasland
as code owners
October 30, 2026 03:38
cmaloney
commented
Oct 30, 2026
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Argument Clinic
@vectorcallgeneration accepted*argsparameters but the generated code expected an argument tuple. The first commit uses the fastcall form to parse the args array making it work right.zippreviously hand coded argument parsing and had no vectorcall. Argument error messages are unchanged except for unknown keywords:zip(strict=1, x=2)now reports "got an unexpected keyword argument 'x'" instead of "takes at most 1 keyword argument (2 given)". The docstring gains a summary line;__text_signature__is unchanged.pyperf microbenchmark (PGO+LTO, run serially):
Benchmark hidden because not significant (1):
zip.__new__Benchmark code: