Author martin.panter
Recipients Cesar.Kawakami, Devin Jeanpierre, Kyle.Buzsaki, eryksun, ezio.melotti, martin.panter, ncoghlan, r.david.murray, rhettinger
Date 2015-04-19.03:34:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429414471.17.0.477073140746.issue23275@psf.upfronthosting.co.za>
In-reply-to
Content
I would prefer this be fixed in the opposite direction, to allow “unpacking” an empty iterable using round brackets. I have used this syntax on purpose as a concise way to ensure that a generator is exhaused with no more yields:

>>> def gen():
...     yield "partial computation"
...     print("computation allowed to complete")
... 
>>> g = gen()
>>> next(g)
'partial computation'
>>> [] = g
computation allowed to complete
History
Date User Action Args
2015-04-19 03:34:31martin.pantersetrecipients: + martin.panter, rhettinger, ncoghlan, Devin Jeanpierre, ezio.melotti, r.david.murray, eryksun, Cesar.Kawakami, Kyle.Buzsaki
2015-04-19 03:34:31martin.pantersetmessageid: <1429414471.17.0.477073140746.issue23275@psf.upfronthosting.co.za>
2015-04-19 03:34:31martin.panterlinkissue23275 messages
2015-04-19 03:34:30martin.pantercreate