TranscryptOrg / Transcrypt

Python 3.9 to JavaScript compiler - Lean, fast, open!
https://www.transcrypt.org
Apache License 2.0
2.85k stars 214 forks source link

Bug in tuple and list unpacking #784

Open trenta3 opened 3 years ago

trenta3 commented 3 years ago
# main.py
a = [3]
print((*a, 7))

transcrypt -m main.py

//  [...]
export var a=[3];
print(tuple([a, 7]))

which thus produces ([3], 7) and not (3, 7)!

On the other hand

# main.py
a = [3]
print(tuple(*a, 7))

produces the correct transcryption print(tuple(...a, 7)).

Transcrypt version: 3.9.0

JennaSys commented 1 year ago

This seems like it might be a similar behavior as on issue #837, where it works in the function call but not using expression syntax.