BSK-W0040
warning
Lambda function missing type annotations
Emitted when a lambda function is assigned to a variable without type annotations. This is a warning rather than an error since lambda functions are often used for simple operations where type annotations might be considered verbose.
# BAD (warning)
f = lambda x: x + 1 # W: lambda assigned to unannotated variable 'f'
# GOOD
f: Callable[[int], int] = lambda x: x + 1 # OK: variable has type annotation
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
BSK-W0040 down per-file or per-path from your editor or
pyproject.toml, or fix the code
so it type-checks. See the Warnings rules and
the complete diagnostic reference.
Canonical URL: https://www.basilisk-python.dev/warnings/BSK-W0040