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
TypeAliasType is the type of what you get when you use the type keyword, eg:
typePoint=tuple[float, float]
It is valid (or at least mypy and pyright allow you to) to pass the resultant type alias (Point in the example above) to functions, in which case it is supposed to have a type of TypeAliasType, However, annotating a function argument as TypeAliasType produces an error in PyType:
The text was updated successfully, but these errors were encountered:
wyattscarpenter
changed the title
PyType cannot handle type annotations of TypeAliasType (treated as callable)
PyType cannot handle type annotations of TypeAliasType (it's treated as callable)
Sep 19, 2024
TypeAliasType is the type of what you get when you use the
type
keyword, eg:It is valid (or at least mypy and pyright allow you to) to pass the resultant type alias (
Point
in the example above) to functions, in which case it is supposed to have a type of TypeAliasType, However, annotating a function argument as TypeAliasType produces an error in PyType:here is the error:
Pyright and mypy don't error on this code, as I've implied.
Possibly related issues:
#1475 (I guess Python 3.12 support is not truly complete until you can do this?)
#1295 (possibly similar decay-to-callable issue?)
The text was updated successfully, but these errors were encountered: