BSK-E0050 error

Invalid NewType(...) call

PEP 484 places restrictions on NewType:

- The string name must match the variable it is assigned to - The base type must be a proper concrete class - NewType accepts exactly two arguments

from typing import NewType
GoodName = NewType("BadName", int)  # E: name mismatch
BadNewType6 = NewType("BadNewType6", int, int)  # E: too many arguments
BadNewType7 = NewType("BadNewType7", Any)  # E: cannot be Any

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial BSK-E0050 down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type System rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/BSK-E0050