You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
The behavior of Annotated has been changed so that it is allowed at runtime to wrap ClassVar and Final. 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, and typing_extensions. pyre should follow suit in allowing the wrapping in order to allow the friction lifting to happen in practice.
Expected behavior
The above code should type check.
Logs
Please include any relevant logs here:
antest/antest.py:4:4 Incompatible attribute type [8]: Attribute `classvar` declared in class `C` has type `typing.Annotated[ClassVar[int]]` but is used as type `int`.antest/antest.py:5:4 Incompatible attribute type [8]: Attribute `const` declared in class `C` has type `typing.Annotated[Final[int]]` but is used as type `int`.antest/antest.py:5:4 Invalid type [31]: Expression `typing.Annotated[Final[int]]` is not a valid type. Final cannot be nested.
Pyre Bug
Bug description
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
. pyre should follow suit in allowing the wrapping in order to allow the friction lifting to happen in practice.Reproduction steps
Expected behavior
The above code should type check.
Logs
Please include any relevant logs here:
Additional context
Client version: 0.9.10
Binary version: d418f5bb10fdee9648eeea3834c8ca56944bd2ce
Corresponding issue for dataclasses (incl
InitVar
) is at https://bugs.python.org/issue46511pyright change: microsoft/pyright@8ce7fa6
mypy bug: python/mypy#12061
pytype bug: google/pytype#1110
The text was updated successfully, but these errors were encountered: