spylang/spy

Nested tuple unpacking

Offen

#456 geöffnet am 07.04.2026

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Python (60 Forks)auto 404
good first issuehelp wanted

Repository-Metriken

Stars
 (803 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 11T 20h) (22 gemergte PRs in 30 T)

Beschreibung

WARNING - full AI-assisted solutions are not welcome for this issue The point of "Good first issues" is to give a chance to humans to interact and learn about the codebase. Writing code using AI assistant prevents this.


This should work:

def main() -> None:
    tup = (1, (2, 3))
    a, (b, c) = tup
    print(a + b + c)

Currently it fails with AssertionError in the parser:

❯ spy /tmp/x.spy 
Traceback (most recent call last):
[...]
  File "/home/antocuni/anaconda/spy/spy/parser.py", line 544, in from_py_stmt_Assign
    assert isinstance(item, py_ast.Name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Contributor Guide