namedtuples_define_class error

NamedTuple class definition errors

Detects several categories of NamedTuple definition errors:

1. **Underscore field names**: Field names starting with _ are illegal in NamedTuple definitions (the runtime raises ValueError).

2. **Default ordering**: Fields with default values must come after all fields without defaults (same rule as the runtime enforces).

3. **Subclass field conflict**: A NamedTuple subclass cannot redefine fields that exist in the base NamedTuple.

4. **Multiple inheritance**: NamedTuple does not support inheriting from multiple bases (other than Generic...).

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial namedtuples_define_class 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/namedtuples_define_class