New submission from Mario Wenzel:
if I have an assignment
a = then a is the generator.
But if I do any kind of unpacking
*a, = # a list of all items
a, *aa = # first item in a, list of rest in as
If the right-hand side is a generator expression, I would expect that
a, *aa unpacks the first element into a and puts the whole generator (having
yielded the first element) back into aa.
So the star-operator of tuple unpacking with the right-hand-side having a
generator should be lazy and not exhaust the whole generator.
--
components: Interpreter Core
messages: 253985
nosy: Mario Wenzel
priority: normal
severity: normal
status: open
title: tuple unpacking on assignment should be lazy for unpacked generators
type: enhancement
versions: Python 3.6
___
Python tracker
<http://bugs.python.org/issue25542>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com