◐ Shell
clean mode source ↗

Revert class lookup by youknowone · Pull Request #7306 · RustPython/RustPython

@youknowone marked this pull request as ready for review

March 2, 2026 03:40
The optimization to skip __class__ lookup based on getattro check
was incorrect: a class can override __class__ as a property while
still using standard __getattribute__. Revert to always performing
the lookup, matching CPython's object_isinstance behavior.

@youknowone youknowone changed the title Skip __class__ lookup in object_isinstance when safe Revert class lookup

Mar 2, 2026

@youknowone

coderabbitai[bot]

youknowone added a commit to youknowone/RustPython that referenced this pull request

Mar 22, 2026
* Revert __class__ lookup skip in object_isinstance

The optimization to skip __class__ lookup based on getattro check
was incorrect: a class can override __class__ as a property while
still using standard __getattribute__. Revert to always performing
the lookup, matching CPython's object_isinstance behavior.

* Collapse nested if in object_isinstance for clippy