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.

Although there are quite easy ways to do so, I would appreciate something like the proposed

   while EXPR as VAR: use VAR
   if EXPR as VAR: use VAR

Of course it is possible to construct a respective workaround such as

    def maybe_do_that():
        if moon == full:
            with something as val:
                yield val

    for val in maybe_do_that():
        bla

but I would consider this as an abuse of the generator concept.

Thomas
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to