Transcrypt icon indicating copy to clipboard operation
Transcrypt copied to clipboard

Bug in tuple and list unpacking

Open trenta3 opened this issue 4 years ago • 1 comments

# 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

trenta3 avatar Jul 16 '21 10:07 trenta3

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.

JennaSys avatar Apr 30 '23 23:04 JennaSys