Message306761
This stems from a query on StackOverflow: https://stackoverflow.com/questions/47272460/python-tuple-unpacking-in-return-statement/
Specifically, the following syntax is allowed:
def f():
rest = (4, 5, 6)
t = 1, 2, 3, *rest
While the following result in SyntaxError:
def g():
rest = (4, 5, 6)
return 1, 2, 3, *rest
def h():
rest = (4, 5, 6)
yield 1, 2, 3, *rest
Looking at the original commit that enabled tuple unpacking in assignment statements:
https://github.com/python/cpython/commit/4905e80c3d2f6abb613d212f0313d1dfe09475dc
I don't believe this difference is intentional.
My GitHub repo incorporates a fix for this; I'll file a pull request momentarily. |
|
Date |
User |
Action |
Args |
2017-11-22 23:31:49 | dacut | set | recipients:
+ dacut |
2017-11-22 23:31:49 | dacut | set | messageid: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> |
2017-11-22 23:31:49 | dacut | link | issue32117 messages |
2017-11-22 23:31:49 | dacut | create | |
|