| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
WalkthroughThe changes refactor type instance and subclass checking in the virtual machine. The __instancecheck__ method on PyType now accepts a VirtualMachine argument and returns PyResult<bool>, delegating to a new real_is_instance method. The is_instance and is_subclass methods are enhanced to handle union types, reorder checks to match CPython, and avoid infinite recursion by using real_is_instance. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant PyType
participant PyObject
participant VirtualMachine
Caller->>PyType: __instancecheck__(obj, vm)
PyType->>PyObject: real_is_instance(self.as_object(), vm)
PyObject->>VirtualMachine: (uses vm for context)
PyObject-->>PyType: PyResult<bool>
PyType-->>Caller: PyResult<bool>
sequenceDiagram
participant Caller
participant PyObject
participant VirtualMachine
Caller->>PyObject: is_instance(cls, vm)
alt cls is a type
PyObject->>PyObject: real_is_instance(cls, vm)
else cls is a union
loop each member in union
PyObject->>PyObject: is_instance(member, vm)
end
else cls is a tuple
loop each member in tuple
PyObject->>PyObject: is_instance(member, vm)
end
else cls has __instancecheck__
PyObject->>cls: __instancecheck__(self, vm)
else
PyObject->>PyObject: real_is_instance(cls, vm)
end
PyObject-->>Caller: PyResult<bool>
Poem
📜 Recent review details Configuration used: CodeRabbit UI Reviewing files that changed from the base of the PR and between 1b40c45 and dd90515. 📒 Files selected for processing (3)
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
Learnt from: CR PR: RustPython/RustPython#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-06-26T12:52:11.109Z Learning: When a test fails due to unsupported Python syntax or features, keep the test as '@unittest.expectedFailure' and document the reason, rather than modifying the test logic or data.
Lib/test/test_isinstance.py (3)✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ Share 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (.coderabbit.yaml)
Documentation and Community
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary by CodeRabbit
Bug Fixes
Refactor