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
{{ message }}
Repository navigation
NewType type restrictions are not enforced by pyright #6830
When creating a new type with the NewType call, there are several restrictions that pyright doesn't currently enforce but mypy does. Mypy is conformant with the spec in this regard.
A TypedDict type isn't allowed because it's a structural type
Another type created with NewType isn't allowed
Any isn't allowed
Pyright already detects and flags several other conditions:
Activity
Added additional checks for invalid `NewType` calls. This addresses #…
Added additional checks for invalid `NewType` calls. This addresses #…
erictraut commentedon Dec 30, 2023
This is addressed in pyright 1.1.344, which I just published. It will also be included in a future release of pylance.