Revert class lookup by youknowone · Pull Request #7306 · RustPython/RustPython
marked this pull request as ready for review
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
changed the title
Skip __class__ lookup in object_isinstance when safe
Revert class lookup
youknowone added a commit to youknowone/RustPython that referenced this pull request
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters