← board

nilpy: tuple return

Repro

def two():
    return 1, "a"
a, b = two()

-> error: Nil Python: expected newline after statement at the return.

Tuple unpacking itself works — a, b = 1, 2 and w, h = "200x100".split("x") both compile and run (see feature-nilpy-tuple-unpack, done). Only the bare tuple in a return is unparsed.

Why it matters

Multiple return values without a wrapper type is everywhere in real Python. songformatter's tones_to_guitar returns "xxxxxx", [0,0,0,0,0,0], and the chord parsing helpers return pairs.

Gate

make test-nilpy green with a .npy case returning and unpacking pairs (including mixed types) diffed against CPython, + --tier quick + self-host byte-identical.

Log