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
Changed in version 3.10: NewType is now a class rather than a function. There is some additional runtime cost when calling NewType over a regular function. However, this cost will be reduced in 3.11.0.
In Python >=3.10, NewType is a class rather than a function, meaning the mypy documentation is now incorrect.
I'm not immediately sure how it could be rewritten in a more accurate way that is still concise, however.
The documentation for
NewTypeat https://mypy.readthedocs.io/en/stable/more_types.html#newtypes states:However, as the cpython documentation for
NewType` states:In Python >=3.10,
NewTypeis a class rather than a function, meaning the mypy documentation is now incorrect.I'm not immediately sure how it could be rewritten in a more accurate way that is still concise, however.