Skip to content

Add a few more tests for mypyc_attr native_class (dunder methods and metaclasses) #18999

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

Merged
merged 3 commits into from
May 2, 2025

Conversation

svalentin
Copy link
Collaborator

No description provided.

Testing dunder methods and metaclasses
@svalentin svalentin requested a review from JukkaL April 29, 2025 15:47
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe also mention in the error message that the metaclass is not supported with a native class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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
@JukkaL JukkaL merged commit daf8922 into python:master May 2, 2025
12 checks passed
svalentin added a commit to svalentin/mypy that referenced this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants