Repository navigation
Preserve reflected addition for sequence subclasses - #9049
Conversation
Extract the Python 3.14-compatible sequence-add slot distinction from RustPython#8954 without its unconditional numeric-slot clearing. Preserve stateful duplicate-slot behavior, exact descriptor identity, inherited reflected priority and a stable wrapper function address. Extend the existing addition snippet only for the uncovered inherited-native and slot-update cases. Assisted-by: OpenAI Codex:model identifier unavailable
Assisted-by: OpenAI Codex:model identifier unavailable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The focused addition-dispatch checks are reported to pass, and no actionable issue is established. Normal CI completion remains pending. Pre-merge checks |
|
Codex Review SummaryThis 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. |
Summary
Extract the remaining sequence-subclass reflected-addition fix from #8954 (
43065e79ddc46eafeca58cb39398ac007b5d25f7), adapted to the exact Python 3.14 slot contract on main3af5f8a15314446d2b28a90e429c938dc7b8beeb.Plain sequence subclasses inheriting a native concatenation descriptor must allow an unrelated right operand's
__radd__. Preserve the distinction between inherited sequence concatenation and a numeric addition slot when methods are assigned, inherited, replaced, or deleted. Update the paired left slot when reflected addition changes, and use one stable numeric wrapper function identity.The mega's unconditional treatment of native concatenation descriptors is insufficient for Python 3.14's stateful slot behavior. This patch preserves already-established numeric slots, exact descriptor identity/name, custom MRO membership, and unrelated numeric-subclass reflected priority. It follows CPython 3.14.7 type slot machinery.
Merged #8822 is already in the base and covers earlier override handling; this addresses the remaining inherited-native-sequence case rather than duplicating that change. No other direct duplicate appeared in the checked open/merged PR searches.
Validation
builtin_str_add.pysnippet passes.test_binop,test_augassign, andtest_operatormodules pass: 129 tests.Coverage stays in the existing Python snippet; no Rust behavioral tests, canonical-test weakening, implementation-name guards, or README changes. Local checks are bounded Linux checks, not a complete workspace or cross-platform test claim. Full hosted CI is pending; this remains a draft for review.
AI-assisted implementation and validation with OpenAI Codex; model identifier unavailable. No human review is implied.
Summary by CodeRabbit
str,bytes,tuple,list, andbytearray, including when addition methods are inherited, overridden, assigned, or deleted.