KEMBAR78
special case types.DynamicClassAttribute as property-like by tungol · Pull Request #18150 · python/mypy · GitHub
Skip to content

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.
@github-actions

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.

@github-actions
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