namedtuples_define_functional error

Invalid argument in a NamedTuple constructor call

When a NamedTuple is instantiated using keyword arguments, Basilisk validates each argument against the field names and field types declared in the NamedTuple(...) definition.

Two kinds of violation are caught:

1. **Unknown field** — a keyword whose name is not among the declared fields. 2. **Type mismatch** — a keyword whose literal value is incompatible with the declared field type (e.g. passing a str literal for an int field).

X: Final = "x"
Y: Final = "y"
N = NamedTuple("N", [(X, int), (Y, int)])

N(x=3, y=4)        # OK
N(a=1)             # E: unknown field `a`
N(x="", y="")      # E: field `x` expects `int` but got `str`

How to handle it

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