Open GBeauregard opened 2 years ago
I'd like to take this task. I'm pretty happy my comment led to this change so I'm happy to cover the pr. I'll try to do it this weekend.
No. That is related (but little different) python typing runtime change, while this issue is for type checker change. I'd forgotten about this mypy issue.
Bug Report
The behavior of
Annotated
has been changed so that it is allowed at runtime to wrapClassVar
andFinal
. This change helps avoid friction with other users of annotations; see https://bugs.python.org/issue46491 for context. This change has landed in 3.11 and has been backported to 3.9, 3.10, andtyping_extensions
. mypy should follow suit in allowing the wrapping in order to allow the friction lifting to happen in practice.To Reproduce
Expected Behavior
The above code should type check.
Actual Behavior
Your Environment
mypy.ini
(and other config files): noneAdditional Context Corresponding issue for dataclasses (incl
InitVar
) is at https://bugs.python.org/issue46511 pyright changed at https://github.com/microsoft/pyright/commit/8ce7fa6e0ad883fb17407add955273bbfbe506c5 pytype issue at https://github.com/google/pytype/issues/1110 pyre issue at https://github.com/facebook/pyre-check/issues/577