Repository navigation
Align itertools constructor binding and conversions - #9632
Merged
youknowone merged 9 commits intoNov 7, 2026
Merged
youknowone merged 9 commits into
youknowone merged 9 commits into
Conversation
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Assisted-by: OpenAI Codex:model version not exposed
Bind the two required and two optional raw positional arguments together. Preserve explicit None values and deferred index conversion while removing the per-arity parsing branches. Assisted-by: OpenAI Codex:model version not exposed
Use PyIter for cycle, starmap, takewhile, dropwhile, filterfalse, and pairwise now that positional arity and keyword checks precede conversion. Keep _tee source ownership through its position snapshot, and cover constructor callbacks, subclass keywords, and source finalization. Use an islice step expression and gate the remaining int value helper to its test, serde, and JIT consumers to keep Clippy clean. Assisted-by: OpenAI Codex:model version not exposed
youknowdot
force-pushed
the
fix/itertools-constructor-binding-20261103
branch
from
November 6, 2026 03:01
c756f0d to
60e3d91
Compare
youknowone
reviewed
Nov 6, 2026
| struct CompressNewArgs { | ||
| #[pyarg(any)] | ||
| data: PyIter, | ||
| data: PyObjectRef, |
youknowone
approved these changes
Nov 7, 2026
youknowone
marked this pull request as ready for review
November 7, 2026 11:57
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
tee's optional count before invoking__index__.PyIterarguments forcycle,starmap,takewhile,dropwhile,filterfalse, andpairwise, whose positional arity and keyword checks now happen before conversion. Retain deferred conversion where ordering or source lifetime requires it. In particular,_teemust keep its source alive until copying an existing tee's position.batchedsigned-size conversion, strict truth testing, partial-batch and source-error behavior, andislicestart/stop/step conversion ordering and ValueErrors.None. Share the C-ssize conversion for relevant counts and retain user conversion exceptions.__iter__, direct__new__calls, subclass keywords, and_teesource finalization. Resolve the related Clippy warnings.Validation
cargo test --locked -p rustpython-vm --lib: 170 passed.stdlib,stdio,importlib,host_env,doc,threading;rustpython -m test test_itertools: SUCCESS, 137 run, 22 skipped.pytest -v test_snippets.py -k stdlib_itertools: 2 passed (RustPython and CPython 3.12.14).compiler,gc,host_env,stdio,doc,threading,importlib,encodings: passed without warnings.This does not claim complete constructor parity. Existing arity-versus-keyword diagnostic precedence, other allocation and argument/source lifetime differences,
try_indexnormalization details, and broader concurrency behavior remain outside scope. Deferred conversion retains the original argument during the constructor call and adds bounded reference-management work; no benchmark was run.zip_longestvariadic binding remains unchanged because deferring it requires a separately assessed temporary allocation.AI assistance
OpenAI Codex assisted with implementation, source review, regression tests, and local validation.