Python Forum

Full Version: PEP 492 - Coroutines [async/await]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
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
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.
(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.