while expression feature proposal

Ian Kelly ian.g.kelly at gmail.com
Thu Oct 25 12:44:17 EDT 2012


On Thu, Oct 25, 2012 at 3:52 AM, Thomas Rachel
<nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de>
wrote:
> Am 25.10.2012 06:50 schrieb Terry Reedy:
>
>
>> Keep in mind that any new syntax has to be a substantial improvement in
>> some sense or make something new possible. There was no new syntax in
>> 3.2 and very little in 3.3.
>
>
> I would consinder this at least as new substantial than
>
>     yield_from it
>
> as opposed to
>
>     for i in it: yield i
>
> - although I think that was a good idea as well.

Except that those two are not exactly identical, because "yield from"
also properly delegates sent data and exceptions to the sub-generator.
 The actual equivalent code for "yield from expr()", as given in the
PEP, is 39 lines long.  This is a substantial feature, not just a
little syntactic sugar.



More information about the Python-list mailing list