Add a few more tests for mypyc_attr native_class (dunder methods and metaclasses)#18999
Merged
JukkaL merged 3 commits intopython:masterfrom May 2, 2025
Merged
Add a few more tests for mypyc_attr native_class (dunder methods and metaclasses)#18999JukkaL merged 3 commits intopython:masterfrom
JukkaL merged 3 commits intopython:masterfrom
Conversation
Testing dunder methods and metaclasses
a86ea9e to
7df6ab1
Compare
JukkaL
reviewed
Apr 29, 2025
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Left some suggestions. Can you also check the build failures?
| pass | ||
|
|
||
| @mypyc_attr(native_class=True) | ||
| class A(metaclass=M): # E: Class is marked as native_class=True but it can't be a native class |
Collaborator
There was a problem hiding this comment.
Maybe also mention in the error message that the metaclass is not supported with a native class?
Collaborator
Author
There was a problem hiding this comment.
Let me separate this out to its own PR. Right now is_implicit_extension_class (in mypyc/irbuild/util.py) just returns True/False. To print a nice message we would have to go through each individual check in is_implicit_extension_class and make a nice user-facing message.
It is very good feedback, and I agree with you, just think it can be split out to separate PR.
svalentin
added a commit
to svalentin/mypy
that referenced
this pull request
May 2, 2025
Addresses feedback in python#18999
JukkaL
approved these changes
May 2, 2025
svalentin
added a commit
to svalentin/mypy
that referenced
this pull request
May 2, 2025
Addresses feedback in python#18999
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.