The Wayback Machine - https://web.archive.org/web/20260221225905/https://github.com/python/cpython/pull/144997
Skip to content

Comments

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

1 participant