| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This looks reasonable as a short-term fix . We can continue supporting this use case, though users will have to add an explicit ClassVar annotation.
Sorry, something went wrong.
|
What about mentioning this in the documentation? This may be non-obvious for users. |
Sorry, something went wrong.
|
Good point! I will add the docs later today. |
Sorry, something went wrong.
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Sorry, something went wrong.
Ref #19274 This is a bit ugly. But I propose to have this "hot-fix" until we have a proper overhaul of instance vs class variables. To be clear: attribute access already works correctly (on both `P` and `Type[P]`), but subtyping returns false because of ```python elif (IS_CLASSVAR in subflags) != (IS_CLASSVAR in superflags): return False ```
| Back | FazBrowse Home | New Git URL |
Ref #19274
This is a bit ugly. But I propose to have this "hot-fix" until we have a proper overhaul of instance vs class variables. To be clear: attribute access already works correctly (on both P and Type[P]), but subtyping returns false because of