Message241474
| 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 |
|