callables_annotation
error
Invalid type argument count or form
Certain generic types accept a fixed number of type arguments. This rule catches the most common violations detectable from source text alone:
| Annotation pattern | Expected args | Error condition | |---|---|---| | list... | exactly 1 | 0 or 2+ args | | set... | exactly 1 | 0 or 2+ args | | frozenset... | exactly 1 | 0 or 2+ args | | type... | exactly 1 | 0 or 2+ args | | Type... | exactly 1 | 0 or 2+ args | | dict... | exactly 2 | 0, 1, or 3+ args | | Callable... | exactly 2 | wrong count or invalid form |
For Callable, the first argument must be a parameter list int, str, bare ellipsis ..., a ParamSpec, or Concatenate.... The second argument (return type) must not be a list literal.
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
callables_annotation 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/callables_annotation