BSK-E0144
error
Invalid constructor call via typeT parameter
When a parameter is typed as typeT (where T is a concrete class or a type variable), calling it as a constructor is equivalent to calling T(...). This rule checks that the arguments passed to such calls are consistent with the constructor of T.
Specification: <https://typing.readthedocs.io/en/latest/spec/constructors.html#constructor-calls-for-type-t>
## Cases detected
1. cls: typeClass where Class.__init__ / Class.__new__ / metaclass __call__ requires arguments but cls() is called with none. 2. cls: typeClass where Class has no custom constructor but cls(arg) is called with extra arguments. 3. cls: typeT (unbound TypeVar) called with any arguments — the constraint is unknown, so no arguments are permitted. 4. cls: typeT where T is bounded: same rules as the bound class.
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
BSK-E0144 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-E0144