Skip to content

gh-144873: Document isinstance Edge Case - #144997

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

George-Ogden wants to merge 2 commits into
python:mainfrom
George-Ogden:gh-144873v2

Conversation

@George-Ogden

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

Copy link
Copy Markdown
Contributor

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/

@rhettinger

Copy link
Copy Markdown
Contributor

As Guido explained, this isn't an optimization. It is core functionality with well-defined semantics.

@George-Ogden George-Ogden changed the title gh-144873: Document isinstance Optimization gh-144873: Document isinstance Edge Case Feb 22, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 7, 2026
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 stale Stale PR or inactive for long period of time.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Overzealous Optimization For isinstance

2 participants