Skip to content

[stubgen] Preserve dataclass_transform decorator #18418

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

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jan 5, 2025

Ref: #18081

Copy link
Collaborator

@hamdanal hamdanal left a comment

Choose a reason for hiding this comment

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

Thanks. Could you add a non-semanal test?

@cdce8p
Copy link
Collaborator Author

cdce8p commented Jan 5, 2025

Could you add a non-semanal test?

Not sure that would be helpful here. All cases for dataclass_transform depend on the semantic analysis. Without it, the derived classes wouldn't be recognized as dataclass. I.e. the tests would all fail AFAICT.

@hamdanal
Copy link
Collaborator

hamdanal commented Jan 5, 2025

I still think it is useful to have a test, just to be sure we do not generate a broken syntax or something. You can leave a comment in the test saying that it is not expected to work as good as with semantic analysis.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Great

@hauntsaninja hauntsaninja merged commit 20355d5 into python:master Jan 7, 2025
12 checks passed
@cdce8p cdce8p deleted the stubgen-preserve-dataclass_transform branch January 7, 2025 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants