GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Sequence-like subclass `__radd__` fallback regression · Issue #146587 · python/cpython

Sequence-like subclass __radd__ fallback regression #146587

New issue
Copy link
New issue
Copy link
Closed
Closed
Sequence-like subclass __radd__ fallback regression#146587
Copy link
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

@inventshah
inventshah
opened on Mar 29, 2026
Issue body actions

Bug report

Bug description:

In the 3.15 alphas, the + operator does not dispatch to obj.__radd__ when the left hand object inherits from a sequence like class (list, tuple, ...), but does if it is a base instance.

class A:
    def __radd__(self, other): ...

class B(tuple): ...

() + A()  # No error
B() + A() # TypeError: can only concatenate tuple (not "A") to tuple

I originally ran into the issue with a NamedTuple, but looks like subclasses of array.array, bytearray, bytes, collections.deque, list, str, and tuple all raise the error.

Works in 3.14.3. git bisect'd to e6e376a, so something in the resolution between nb_add and sq_concat may have changed while optimizing (* has a similar problem with __rmul__ mapping to nb_multiply and sq_repeat).

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

  • gh-146587: fix type slot assignment incase of multiple slots for same name #146593
Reacted by Clément Robert

Activity

  1. inventshah
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 29, 2026
  2. inventshah commented on Mar 29, 2026

    @inventshah
    inventshah
    on Mar 29, 2026
    ContributorAuthor
    More actions

    cc @sergey-miryanov as the bisect'd PR author

  3. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    3.15bugs and security fixesbugs and security fixes
    release-blocker
    on Mar 29, 2026
  4. github-project-automation
    added this to Release and Deferred blockers 🚫on Mar 29, 2026
  5. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on Mar 29, 2026
  6. sergey-miryanov commented on Mar 29, 2026

    @sergey-miryanov
    sergey-miryanov
    on Mar 29, 2026
    Contributor
    More actions

    Will take a look soon

  7. serhiy-storchaka commented on Mar 29, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Mar 29, 2026
    Member
    More actions

    cc @JelleZijlstra, @vstinner

  8. serhiy-storchaka
    added
    3.14bugs and security fixesbugs and security fixes
    and removed
    3.14bugs and security fixesbugs and security fixes
    on Mar 29, 2026
  9. neutrinoceros
    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
  10. kumaraditya303 commented on Mar 29, 2026

    @kumaraditya303
    kumaraditya303
    on Mar 29, 2026
    Contributor
    More actions

    I'm working on a fix.

    Reacted by Clément Robert
  11. kumaraditya303 commented on Mar 29, 2026

    @kumaraditya303
    kumaraditya303
    on Mar 29, 2026
    Contributor
    More actions

    PR #146593 fixes this.

  12. kumaraditya303
    added a commit that references this issue on Mar 29, 2026

    Merge branch 'fix-pythongh-146587' of https://github.com/kumaraditya3…

    8be175f
  13. kumaraditya303
    moved this from Todo to In Progress in Release and Deferred blockers 🚫on Mar 29, 2026
  14. kumaraditya303
    added a commit that references this issue on Mar 30, 2026

    gh-146587: fix type slot assignment incase of multiple slots for same…

    8e10bd7
  15. kumaraditya303
    closed this as completedon Mar 30, 2026
  16. github-project-automation
    moved this from In Progress to Done in Release and Deferred blockers 🚫on Mar 30, 2026
  17. maurycy
    added a commit that references this issue on Mar 30, 2026

    Merge remote-tracking branch 'upstream/main' into tachyon-ndjson-kole…

    6a0ea81
  18. clin1234
    added a commit that references this issue on Apr 16, 2026

    pythongh-146587: fix type slot assignment incase of multiple slots fo…

    b3eeeb8
  19. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-146587: fix type slot assignment incase of multiple slots fo…

    b369302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

    • Release and Deferred blockers 🚫
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.