python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.53k stars 2.83k forks source link

special case types.DynamicClassAttribute as property-like #18150

Closed tungol closed 1 day ago

tungol commented 1 week ago

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

Would enable https://github.com/python/typeshed/pull/12762 see also https://github.com/python/mypy/pull/14133

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

github-actions[bot] commented 1 week ago

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

tungol commented 6 days ago

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[bot] commented 6 days ago

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