Skip to content

gh-144873: Document isinstance Optimization#144997

Open
George-Ogden wants to merge 2 commits intopython:mainfrom
George-Ogden:gh-144873v2
Open

gh-144873: Document isinstance Optimization#144997
George-Ogden wants to merge 2 commits intopython:mainfrom
George-Ogden:gh-144873v2

Conversation

@George-Ogden
Copy link
Contributor

@George-Ogden George-Ogden commented Feb 19, 2026

Fixes #144873 and #79264 by describing the optimization where type(instance) is cls during inistance(instance, cls). It describes that __instancecheck__ is not called in this scenario.


📚 Documentation preview 📚: https://cpython-previews--144997.org.readthedocs.build/

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Overzealous Optimization For isinstance

1 participant

Comments