| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…s instance. Class instances are illegal to use within a type annotation.
There was a problem hiding this comment.
Makes sense! I'd prefer something like class KW_ONLY: ..., since KW_ONLY is actually an instance of _KW_ONLY_TYPE at runtime, so repurposing it is a little confusing (https://github.com/python/cpython/blob/b6bde9fc42aecad5be0457198d17cfe7b481ad79/Lib/dataclasses.py#L192)
Sorry, something went wrong.
|
python/mypy#10867 wanted a similar change (cc @tgallant), so sounds like this is the right direction to take to make this feature implementable for type checkers. There's some CI failures though; you'll probably have to add to the stubtest allowlist. |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
It was previously defined as a class instance, but class instances are illegal when used within a type annotation. It needs to be a class or a type alias that refers to a class.