Message241474
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 |
|
Date |
User |
Action |
Args |
2015-04-19 03:34:31 | martin.panter | set | recipients:
+ martin.panter, rhettinger, ncoghlan, Devin Jeanpierre, ezio.melotti, r.david.murray, eryksun, Cesar.Kawakami, Kyle.Buzsaki |
2015-04-19 03:34:31 | martin.panter | set | messageid: <1429414471.17.0.477073140746.issue23275@psf.upfronthosting.co.za> |
2015-04-19 03:34:31 | martin.panter | link | issue23275 messages |
2015-04-19 03:34:30 | martin.panter | create | |
|