Python Forum
PEP 492 - Coroutines [async/await] - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: PEP 492 - Coroutines [async/await] (/thread-316.html)



PEP 492 - Coroutines [async/await] - nilamo - Oct-05-2016

https://www.python.org/dev/peps/pep-0492/

Apparently this was added in time to be released in 3.5.  I'm running 3.5.2, and thought that this is one of the coolest things imaginable.  So, did you know about this?  Have you messed around with it yet?


RE: PEP 492 - Coroutines [async/await] - micseydel - Oct-05-2016

I'm similarly psyched but haven't used it yet. I read about it a while ago, but don't often have uses for stuff like this, especially for what I use Python for (I use non-Jython JVM stuff at work, not that Jython supports Python 3 anyway). If Python can really find its way to Android, stuff like this will be absolutely wonderful though.


RE: PEP 492 - Coroutines [async/await] - nilamo - Oct-05-2016

I immediately thought it'd be cool with urllib2/requests, so you could setup some handlers and work with the pages whenever they finished downloading. ...and then I immediately found out requests isn't awaitable, so the first step would have to be creating a threaded wrapper around it, which... isn't the quick sort of fun I was looking for, lol


RE: PEP 492 - Coroutines [async/await] - micseydel - Oct-05-2016

Yeah, I think the standard libs aren't really incorporating it yet. They rushed to get it in at all. You can often copy-paste the standard libs and modify them yourself though.


RE: PEP 492 - Coroutines [async/await] - snippsat - Oct-05-2016

(Oct-05-2016, 04:06 PM)nilamo Wrote: Apparently this was added in time to be released in 3.5.  I'm running 3.5.2, and thought that this is one of the coolest things imaginable.  So, did you know about this?
Yes have know this for some time,not tested it yet.
David Beazley has a least 2-3 videos about this topic,here is one.