Repository navigation
Fix recursive sequence repetition fallback - #8865
Conversation
Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: Codex:GPT-6
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RustPython/RustPython/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughSequence repetition now uses sequence slots and shared binary-operator dispatch. In-place concatenation and repetition use binary operator fallbacks. New tests cover unsupported operands, count conversion, method fallback, and error messages. ChangesSequence operator dispatch
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains; the reviewed multiplication and direct sequence-operation paths preserve their supported behavior. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changed dispatch appears to keep repetition within the existing VM object model, without adding a privilege path. It changes broadly used operator behavior, however, and security coverage is incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Raise
TypeErrorinstead of overflowing the native stack when*=is used with a sequence that does not support repetition, includingrangeand classes defining only__getitem__.The presence of an item slot made
_imulcallPySequence::inplace_repeat, which called_imulagain when no repeat slot existed. Correct the numeric and sequence fallbacks:TypeErroror index-sizedOverflowError, including the original count type in overflow messages. In-place multiplication only tries the right sequence when the left type has no sequence table, and never mutates that right operand.__mul__,__rmul__and__imul__populate numeric slots without redundant sequence wrappers; native repeat slots remain inherited. This prevents duplicate method calls and leakedNotImplementedresults after numeric dispatch declines an operation.Known limitations
A native
listsubclass still receives numeric wrappers for inherited sequence methods. Invalid-count messages, inherited__imul__precedence and the result type after deleting an__imul__override can differ from CPython; these pre-existing differences remain unchanged.AI assistance
Written with Claude Code (claude-opus-5-5) and Codex (GPT-6), reviewed by a human before submission.
Summary by CodeRabbit