Repository navigation
Sequence-like subclass __radd__ fallback regression #146587
Copy link
Copy link
Closed
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Mar 29, 2026 cc @sergey-miryanov as the bisect'd PR author
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)3.15bugs and security fixesbugs and security fixes
on Mar 29, 2026 Will take a look soon
- added3.14bugs and security fixesbugs and security fixesand removed3.14bugs and security fixesbugs and security fixes
on Mar 29, 2026 - marked right operand's __radd__ method is ignored when the left operand is a NamedTuple (3.15.0a7) #146592 as a duplicate of this issue
on Mar 29, 2026 I'm working on a fix.
Reacted by Clément RobertPR #146593 fixes this.
- added a commit that references this issue
on Mar 30, 2026 - moved this from In Progress to Done in Release and Deferred blockers 🚫
on Mar 30, 2026 - added a commit that references this issue
on Mar 30, 2026
Metadata
Metadata
Assignees
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
In the 3.15 alphas, the
+operator does not dispatch toobj.__radd__when the left hand object inherits from a sequence like class (list,tuple, ...), but does if it is a base instance.I originally ran into the issue with a
NamedTuple, but looks like subclasses ofarray.array,bytearray,bytes,collections.deque,list,str, andtupleall raise the error.Works in 3.14.3. git bisect'd to e6e376a, so something in the resolution between
nb_addandsq_concatmay have changed while optimizing (*has a similar problem with__rmul__mapping tonb_multiplyandsq_repeat).CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs