Skip to content
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

special case types.DynamicClassAttribute as property-like #18150

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Nov 13, 2024

This enables typeshed to define types.DynamicClassAttribute as a different class from builtins.property without breakage.

Would enable python/typeshed#12762
see also #14133

Let me know if a test case is desired for this.

This enables typeshed to define types.DynamicClassAttribute as a
different class from builtins.property without breakage.

This comment has been minimized.

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.

It would be good to have at least a basic test case, especially if there are plans to change the definition of types.DynamicClassAttribute in typeshed. The test should use the full stubs (e.g. pythoneval.test).

@tungol
Copy link
Contributor Author

tungol commented Nov 16, 2024

I added a test case which is a simplified version of the two errors that mypy-primer found when I tried to change the definition of DynamicClassAttribute in typeshed.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

Thanks for adding a test case! Looks good.

@JukkaL JukkaL merged commit e840275 into python:master Nov 21, 2024
19 checks passed
@tungol tungol deleted the DynamicClassAttribute branch November 21, 2024 17:57
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