Skip to content

[mypyc] Document some of our inheritance conventions #19370

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 2, 2025

Our policy wasn't clear from just reading the code.

Our policy wasn't clear from just reading the code.
Comment on lines +22 to +23
This makes it possible to use isinstance(x, <concrete Value
subclass>) checks without worrying about potential subclasses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be a good idea to mark the concrete classes as @final to document/enforce this?

On a somewhat related noted, can/does mypyc optimize isinstance checks with final types?

@brianschubert brianschubert added the topic-mypyc mypyc bugs label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-mypyc mypyc bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants