unused-unpacked-variable
What it does
Section titled “What it does”Reports a name of a tuple target in a function that the function never reads. A name that starts with _ and a function that calls locals() are left alone.
Why it matters
Section titled “Why it matters”a, b = f() where b is not used binds a value for nothing, and the reader looks for where it is used. The unused value is also a hint that the function returns more than the caller needs.
To fix, name it _, or take only the items that are used.
Example
Section titled “Example”def f(): a, b = g() return a
class A:...Configuration
Section titled “Configuration”python: lint: rules: unused-unpacked-variable: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line unused-unpacked-variable 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 | RUF059 |
full |