-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Type alias type #6011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type alias type #6011
Conversation
WalkthroughThe changes introduce stricter argument validation to the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant VM
participant PyBaseObject
participant PyType
Caller->>VM: Call object.__new__(type, *args, **kwargs)
VM->>PyType: Check __new__ and __init__ methods
alt Arguments passed
alt Custom __new__ or __init__
VM->>PyBaseObject: Allow construction
else Base __new__ and __init__
VM->>Caller: Raise TypeError
end
else No arguments
VM->>PyBaseObject: Proceed with construction
end
sequenceDiagram
participant Caller
participant VM
participant TypeAliasType
Caller->>VM: Call TypeAliasType.__new__(cls, name, value, type_params=...)
VM->>TypeAliasType: Validate argument count and types
alt Argument validation fails
VM->>Caller: Raise TypeError
else Validation passes
VM->>TypeAliasType: Create instance
TypeAliasType-->>Caller: Return instance
end
sequenceDiagram
participant Caller
participant VM
participant NodeAst
participant BaseObject
Caller->>VM: Call NodeAst.__new__(cls, *args, **kwargs)
VM->>NodeAst: slot_new creates base object with dict if needed
NodeAst->>NodeAst: Call __init__ with args
NodeAst-->>Caller: Return initialized instance
Estimated code review effort
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yml ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.rsInstructions used from: Sources:
🧠 Learnings (2)📓 Common learnings
vm/src/stdlib/ast/python.rs (1)Learnt from: CR 🔇 Additional comments (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. 🪧 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
Documentation and Community
|
Summary by CodeRabbit