KEMBAR78
Add a few more tests for mypyc_attr native_class (dunder methods and metaclasses) by svalentin · Pull Request #18999 · python/mypy · GitHub
Skip to content

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
@svalentin svalentin deleted the extension-class branch May 8, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants