Skip to content

gh-62912: fix pure-Python operator.index()#148023

Open
skirpichev wants to merge 1 commit intopython:mainfrom
skirpichev:pyoperator.index/62912
Open

gh-62912: fix pure-Python operator.index()#148023
skirpichev wants to merge 1 commit intopython:mainfrom
skirpichev:pyoperator.index/62912

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented Apr 2, 2026

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@skirpichev
Copy link
Copy Markdown
Member Author

CC @serhiy-storchaka

This is based on your patch, especially tests. But I believe that this simplified version is now ok. Strictly speaking, new docs lie for some broken int's subclasses like:

class BadInt(int):
    def __index__(self):
        return 42

We need to fix also concat/iconcat. But I would prefer to do this in a separate PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant