ruff/crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md
2025-05-03 19:49:15 +02:00

403 B

Unpacking

Right hand side not iterable

a, b = 1  # error: [not-iterable]

Exactly too many values to unpack

a, b = (1, 2, 3)  # error: [invalid-assignment]

Exactly too few values to unpack

a, b = (1,)  # error: [invalid-assignment]

Too few values to unpack

[a, *b, c, d] = (1, 2)  # error: [invalid-assignment]