ruff/crates/ruff_linter/resources/test/fixtures/pyflakes/F841_1.py
Tom Kuson 8c0d65c98e
Fix F841 false negative on assignment to multiple variables (#8489)
## Summary

Closes #8441 behind preview feature flag.

## Test Plan

`cargo test`
2023-11-05 12:01:10 -05:00

24 lines
362 B
Python

def f(tup):
x, y = tup
def f():
x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed
def f():
(x, y) = coords = 1, 2
if x > 1:
print(coords)
def f():
(x, y) = coords = 1, 2
def f():
coords = (x, y) = 1, 2
def f():
(a, b) = (x, y) = 1, 2 # this triggers F841 on everything