[issue25542] tuple unpacking on assignment should be lazy for unpacked generators

Martin Panter report at bugs.python.org
Tue Nov 3 08:08:21 EST 2015


Martin Panter added the comment:

But when the starred element is not the final one, it couldn’t be lazy, so you would end up with an inconsistency.

a, *rest, z = <generator>

Also, it would be inconsistent with other kinds of iterables, which get turned into list objects.

>>> a, *aa = (1, 2)
>>> aa
[2]
>>> a, *aa = "abc"
>>> aa
['b', 'c']

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25542>
_______________________________________


More information about the Python-bugs-list mailing list