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

2015-05-06 Thread Guido van Rossum
Thanks for these stats! (Though I'm sure there's some bias because Tkinter is in the stdlib and the others aren't. Stdlib status still counts a lot for many people, pip notwithstanding. (But that's a different thread. :-)) FWIW I tried to get the Tkinter-asyncio demo mentioned in the above thread

Re: [Python-Dev] Ancient use of generators

2015-05-06 Thread Nick Coghlan
David Beazley's tutorials on these topics are also excellent: * Generator Tricks for Systems Programmers (PyCon 2008: http://www.dabeaz.com/generators/) * A Curious Course on Coroutines and Concurrency (PyCon 2009: http://www.dabeaz.com/coroutines/) * Generators: The Final Frontier (PyCon 2014: ht

Re: [Python-Dev] Clarification of PEP 476 "opting out" section

2015-05-06 Thread Nick Coghlan
On 30 Apr 2015 5:59 pm, "M.-A. Lemburg" wrote: > On 30.04.2015 02:33, Nick Coghlan wrote: > > Hi folks, > > > > This is just a note to highlight the fact that I tweaked the "Opting > > out" section in PEP 476 based on various discussions I've had over the > > past few months: https://hg.python.or

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

2015-05-06 Thread Terry Reedy
On 5/6/2015 5:39 PM, Guido van Rossum wrote: Sorry to send you on such a wild goose chase! I did mean the issue you found #21). I just updated it with a link to a thread that has more news: https://groups.google.com/forum/#!searchin/python-tulip/tkinter/python-tulip/TaSVW-pjWro/hCP6qS4eRnAJ

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

2015-05-06 Thread Ben Darnell
On Tue, May 5, 2015 at 1:39 PM, Paul Moore wrote: > > It would probably be helpful to have a concrete example of a basic > event loop that did *nothing* but schedule tasks. No IO waiting or > similar, just scheduling. I have a gut feeling that event loops are > more than just asyncio, but without

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

2015-05-06 Thread Guido van Rossum
Sorry to send you on such a wild goose chase! I did mean the issue you found #21). I just updated it with a link to a thread that has more news: https://groups.google.com/forum/#!searchin/python-tulip/tkinter/python-tulip/TaSVW-pjWro/hCP6qS4eRnAJ I wasn't able to verify the version by Luciano Ra

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

2015-05-06 Thread Terry Reedy
On 5/5/2015 10:59 PM, Guido van Rossum wrote: For this you should probably use an integration of asyncio (which can do async subprocess output nicely) with Tkinter. Over in tulip-land there is an demo of such an integration. After redirection from googlecode tulip, I found https://github.com/py

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

2015-05-06 Thread Yury Selivanov
Hi Ben, On 2015-05-06 12:05 AM, Ben Darnell wrote: On Tue, May 5, 2015 at 3:25 PM, Yury Selivanov wrote: Yes, there is no other popular event loop for 3.4 other than asyncio, that uses coroutines based on generators (as far as I know). Tornado supports Python 3.4 and uses generator-based co

[Python-Dev] Ancient use of generators

2015-05-06 Thread Guido van Rossum
For those interested in tracking the history of generators and coroutines in Python, I just found out that PEP 342 (which introduced send/throw/close and made "generators as coroutines" a mainstream Python concept) harks back to PEP 288

Re: [Python-Dev] Minimal async event loop and async utilities (Was: PEP 492: async/await in Python; version 4)

2015-05-06 Thread Guido van Rossum
On Wed, May 6, 2015 at 1:27 AM, Paul Moore wrote: > On 6 May 2015 at 07:46, Greg Ewing wrote: > > Another problem with the "core" idea is that > > you can't start with an event loop that "just does > > scheduling" and then add on other features such > > as I/O *from the outside*. There has to be

Re: [Python-Dev] Accepting PEP 492 (async/await)

2015-05-06 Thread Larry Hastings
On 05/05/2015 04:53 PM, Guido van Rossum wrote: I've given Yury clear instructions to focus on how to proceed -- he's to work with another core dev on getting the implementation ready in time for beta 1 (scheduled for May 24, but I think the target date should be May 19). Released on Sunday M

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

2015-05-06 Thread Greg Ewing
Terry Reedy wrote: What I do not understand is how io events become event loop Event instances. They don't become Events exactly, but you can register a callback to be called when a file becomes ready for reading or writing, see: http://effbot.org/pyfaq/can-i-have-tk-events-handled-while-wait

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

2015-05-06 Thread Greg Ewing
Paul Moore wrote: I can't see how you can meaningfully talk about event loops in a Python context without having *some* term for "things you wait for". PEP 3152 was my attempt at showing how you could do that. -- Greg ___ Python-Dev mailing list Pyth

Re: [Python-Dev] PEP 492: What is the real goal?

2015-05-06 Thread Oscar Benjamin
On 5 May 2015 at 17:48, Yury Selivanov wrote: > > I've updated the PEP with some fixes of the terminology: > https://hg.python.org/peps/rev/f156b272f860 Yes that looks better. > I still think that 'coroutine functions' and 'coroutines' > is a better pair than 'async functions' and 'coroutines'.

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

2015-05-06 Thread Greg Ewing
Guido van Rossum wrote: the bytecode generated for await treats coroutine objects special, just like the bytecode generated for yield-from treats generator objects special. The special behavior they have in common is the presence of send() and throw() methods, I don't think that's quit accura

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

2015-05-06 Thread Paul Moore
On 6 May 2015 at 09:20, Greg Ewing wrote: >> That doesn't cover any of the higher level abstractions like tasks or >> futures (at least not by those names or with those interfaces). > > Because a minimal event loop doesn't *need* those. It doesn't *need* them, but as abstractions they allow easie

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

2015-05-06 Thread Wolfgang Langner
Hi Yury, On 05.05.2015 20:25, Yury Selivanov wrote: >> >> We forget to address the major problems here. How can someone in a >> "sync" script use this async stuff easy. How can async and sync stuff >> cooperate and we don't need to rewrite the world for async stuff. >> How can a normal user acce

[Python-Dev] Minimal async event loop and async utilities (Was: PEP 492: async/await in Python; version 4)

2015-05-06 Thread Paul Moore
On 6 May 2015 at 07:46, Greg Ewing wrote: > Another problem with the "core" idea is that > you can't start with an event loop that "just does > scheduling" and then add on other features such > as I/O *from the outside*. There has to be some > point at which everything comes together, which > mean

Re: [Python-Dev] Accepting PEP 492 (async/await)

2015-05-06 Thread Andrew Svetlov
Congrats, Yury! On Wed, May 6, 2015 at 11:07 AM, Paul Moore wrote: > On 6 May 2015 at 00:58, Guido van Rossum wrote: >> I totally forgot to publicly congratulate Yury on this PEP. He's put a huge >> effort into writing the PEP and the implementation and managing the >> discussion, first on pytho

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

2015-05-06 Thread Greg Ewing
Paul Moore wrote: What about Greg Ewing's example? http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/yf_current/Examples/Scheduler/scheduler.txt That doesn't cover any of the higher level abstractions like tasks or futures (at least not by those names or with those interfaces). B

Re: [Python-Dev] Accepting PEP 492 (async/await)

2015-05-06 Thread Paul Moore
On 6 May 2015 at 00:58, Guido van Rossum wrote: > I totally forgot to publicly congratulate Yury on this PEP. He's put a huge > effort into writing the PEP and the implementation and managing the > discussion, first on python-ideas, later on python-dev. Congrats, Yury! And > thanks for your effort