Closed ryanorendorff closed 6 years ago
Thank you for your report. This is indeed a bug. Would you like to submit a PR?
According to my tests, both of the forms (with and without parentheses) are valid in python3.5+:
$ python3.5 -c 'a = 1, 2; b = *a, 3'
and are invalid in python3.4 and older:
$ python3.4 -c 'a = 1, 2; b = *a, 3'
File "<string>", line 1
SyntaxError: can use starred expression only as assignment target
This unpacking feature became available with PEP 448 in python3.5.
I don't think that this is a bug - we should close it.
Good catch, @radomirbosak, thank you!
@ryanorendorff I'm going to close this for now, but we can always reopen if you have time to give us a little bit more information to understand the issue.
Hello,
There seems to be an error turning an ast back into the correct form when expanding tuples. For example, take the following code.
Running
rtrip
on this code fragment leads to the followingwhich unfortunately is not valid python.