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
None as a type on its own, generally does not make sense except as a singleton type and it is used for optional types, which is just an union including None. But in some corner case, None is not a proper name (ex. cases where Void or Null or Unit matches better) and would need to be aliased and will still be used like None is.
I don’t know if there is anything against it in any PEP.
The text was updated successfully, but these errors were encountered:
Supporting T = None as a type alias is problematic because it's difficult to distinguish between a type alias and a normal assignment (assigning global variables to None is quite common).
PEP 613 would solve this (you'd write T: TypeAlias = None), but isn't supported by mypy yet.
🚀 Feature
Allow aliasing like
T = None
.Pitch
None
as a type on its own, generally does not make sense except as a singleton type and it is used for optional types, which is just an union includingNone
. But in some corner case,None
is not a proper name (ex. cases where Void or Null or Unit matches better) and would need to be aliased and will still be used likeNone
is.I don’t know if there is anything against it in any PEP.
The text was updated successfully, but these errors were encountered: