| Store | Cart

Re: [Python-Dev] PEP 492: async/await in Python; v3

From: Greg Ewing <greg...@canterbury.ac.nz>
Wed, 29 Apr 2015 21:13:01 +1200
Yury Selivanov wrote:
> > On 2015-04-28 11:59 PM, Greg wrote:> >> On 29/04/2015 9:49 a.m., Guido van Rossum wrote:>>>>>     *But* every generator-based coroutine *must* be>>>     decorated with `asyncio.coroutine()`.  This is>>>     potentially a backwards incompatible change.>>>>>> See below. I worry about backward compatibility. A lot. Are you saying>>> that asycio-based code that doesn't use @coroutine will break in 3.5?>>>> That seems unavoidable if the goal is for 'await' to only>> work on generators that are intended to implement coroutines,> > Not sure what you mean by "unavoidable".

Guido is worried about existing asyncio-based code that
doesn't always decorate its generators with @coroutine.

If I understand correctly, if you have

    @coroutine
    def coro1():
       yield from coro2()

    def coro2():
       yield from ...

then coro1() would no longer work. In other words,
some currently legitimate asyncio-based code will break
under PEP 492 even if it doesn't use any PEP 492 features.

What you seem to be trying to do here is catch the
mistake of using a non-coroutine iterator as if it
were a coroutine. By "unavoidable" I mean I can't see
a way to achieve that in all possible permutations
without giving up some backward compatibility.

-- 
Greg

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Yury Selivanov Apr 28, 2015 03:07 am
Stefan Behnel Apr 28, 2015 05:43 am
Yury Selivanov Apr 28, 2015 03:22 pm
Ethan Furman Apr 28, 2015 03:29 pm
Yury Selivanov Apr 28, 2015 03:36 pm
Walter Dörwald Apr 28, 2015 02:23 pm
Yury Selivanov Apr 28, 2015 03:21 pm
Guido van Rossum Apr 28, 2015 09:49 pm
Yury Selivanov Apr 28, 2015 11:26 pm
Ethan Furman Apr 28, 2015 11:55 pm
Guido van Rossum Apr 29, 2015 12:04 am
Ethan Furman Apr 29, 2015 05:18 am
Greg Ewing Apr 29, 2015 09:12 am
Yury Selivanov Apr 29, 2015 05:00 am
Greg Ewing Apr 29, 2015 09:13 am
Yury Selivanov Apr 29, 2015 02:01 pm
Greg Ewing Apr 29, 2015 10:46 pm
Yury Selivanov Apr 29, 2015 10:58 pm
Greg Ewing Apr 29, 2015 09:12 am
Yury Selivanov Apr 29, 2015 02:16 pm
Greg Apr 29, 2015 03:59 am
Yury Selivanov Apr 29, 2015 04:10 am
Greg Ewing Apr 29, 2015 09:13 am
Yury Selivanov Apr 29, 2015 02:18 pm
Greg Ewing Apr 29, 2015 09:12 am
Yury Selivanov Apr 29, 2015 02:29 pm
Stephen J. Turnbull Apr 29, 2015 03:03 am
Yury Selivanov Apr 29, 2015 03:23 am
Greg Ewing Apr 29, 2015 09:13 am
Stephen J. Turnbull Apr 29, 2015 02:24 pm
Messages in this thread