[Python-ideas] Is this PEP-able? for X in ListY while conditionZ:

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Jun 27 00:39:23 CEST 2013


I can do this with generators now:

>>> def stop():
...    raise StopIteration
...
>>> list(i for i in range(10) if i < 3 or stop())
[0, 1, 2]

Can't the same be allowed in compehensions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130626/ad748875/attachment.html>


More information about the Python-ideas mailing list