Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed as not planned
Labels
Description
The attached patch adds the missing *-unpacking generalizations.
Specifically:>> a, b, *c = range(5)
>> *a, b, c = a, b, *c>> a, b, c([0, 1, 2], 3, 4)>> [ *a, b, c ][0, 1, 2, 3, 4]>> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]>> [ *item for item in L ][0, 1, 2, 3, 4, 5, 6, 7, 8, 9]Also, yielding everything from an iterator:
>> def flatten(iterables):...for itin iterables:...yield*it... >> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]>> flatten(L)[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]