constructors_call_init
error
Constructor call errors via __init__ method
Detects several categories of constructor call errors when a class defines or inherits __init__:
1. **Specialized generic argument mismatch** (L21): Calling Classint(1.0) when __init__ expects x: T and T=int, but 1.0 is float.
2. **Self type incompatibility** (L42): Passing a base-class instance where Self in __init__ demands a subclass instance.
3. **Explicit self annotation mismatch** (L56): __init__ annotates self as Class4int but the constructor is called as Class4str().
4. **Class-scoped TypeVars in self annotation** (L107): Using class-scoped type variables in a reordered self annotation is invalid.
5. **No custom __init__ with arguments** (L130): Classes inheriting only from object (no custom __init__ or __new__) cannot accept arguments.
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
constructors_call_init 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/constructors_call_init