default-type-arguments
What it does
Section titled “What it does”Reports Generator[X, None, None] and AsyncGenerator[X, None] when the target_version gives the last arguments a default (3.13 and later).
Why it matters
Section titled “Why it matters”From Python 3.13 the send and return types of a generator default to None, so Generator[int] means the same as Generator[int, None, None] and AsyncGenerator[int] the same as AsyncGenerator[int, None]. The extra arguments are noise.
To fix, remove the trailing None arguments.
Example
Section titled “Example”...
...x: Generator[int, None, None]
... pass...Configuration
Section titled “Configuration”python: lint: rules: default-type-arguments: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line default-type-arguments in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ruff | UP043 |
full |