[Python-ideas] return from (was Re: Tail recursion elimination)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 21 07:46:12 CET 2014


Jonathan Slenders wrote:

>     @coroutine
>     def a():
>         return (yield from b())
> 
> You could write it as:
> 
>     def a():
>         return b()

I'm guessing you mean

    def a():
       return from b()

but that wouldn't be a coroutine, because it doesn't
contain a 'yield' anywhere.

-- 
Greg


More information about the Python-ideas mailing list