-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Sequence-like subclass __radd__ fallback regression #146587
Copy link
Copy link
Closed
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs 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
Metadata
Metadata
Assignees
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs 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
Status
Done
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