Mailing List Archive

1 2  View All
Re: PEP 492: async/await in Python; version 5 [ In reply to ]
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
to work but I couldn't (then again Tk on OS X is difficult). If someone
could turn this into a useful event loop that blends asyncio and Tkinter
that would be truly awesome!

On Wed, May 6, 2015 at 6:32 PM, Terry Reedy <tjreedy@udel.edu> wrote:

> 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
>> <
>> https://groups.google.com/forum/#%21searchin/python-tulip/tkinter/python-tulip/TaSVW-pjWro/hCP6qS4eRnAJ
>> >
>> I wasn't able to verify the version by Luciano Ramalho. (And yes,
>> extending all this to working with a subprocess is left as an exercise.
>> It's all pretty academic IMO, given Tkinter's lack of popularity outside
>> IDLE.)
>>
>
> On Stackoverflow pyside has gotten 40 questions tagged in the last 30
> days, wxpython 70 in the last 30 days, pyqt 114 in 30 days, while tkinter
> has gotten 101 in the last week, which would project to about 425 in the
> last 30 days. So tkinter is being used at least by beginners. There have
> been a few tkinter and python-asyncio questions.
>
>
> --
> Terry Jan Reedy
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>



--
--Guido van Rossum (python.org/~guido)
Re: PEP 492: async/await in Python; version 5 [ In reply to ]
On Tue, May 5, 2015 at 3:36 PM, Rajiv Kumar <rajiv.kumar@gmail.com> wrote:

> I wrote a little example[1] that has a bare-bones implementation of Go
> style channels via a custom event loop. I used it to translate the prime
> sieve example from Go[2] almost directly to Python. The code uses "message
> = await channel.receive()" to mimic Go's "message <- channel". Instead of
> using "go func()" to fire off a goroutine, I add the PEP492 coroutine to my
> simple event loop.
>

Cool example!

It's not an efficient implementation - really just a proof of concept that
> you can use async/await in your own code without any reference to asyncio.
> I ended up writing it as I was thinking about how PEP 342 style coroutines
> might look like in an async/await world.
>
> In the course of writing this, I did find that it would be useful to have
> the PEP document how event loops should advance the coroutines (via
> .send(None) for example). It would also be helpful to have the semantics of
> how await interacts with different kinds of awaitables documented. I had to
> play with Yury's implementation to see what it does if the __await__ just
> returns iter([1,2,3]) for example.
>

I've found this too. :-) Yury, perhaps you could show a brief example in
the PEP of how to "drive" a coroutine from e.g. main()?


> - Rajiv
>
> [1] https://gist.github.com/vrajivk/c505310fb79d412afcd5#file-sieve-py
> https://gist.github.com/vrajivk/c505310fb79d412afcd5#file-channel-py
>
> [2] https://golang.org/doc/play/sieve.go
>

--
--Guido van Rossum (python.org/~guido)
Re: PEP 492: async/await in Python; version 5 [ In reply to ]
On 2015-05-07 1:42 PM, Guido van Rossum wrote:
> On Tue, May 5, 2015 at 3:36 PM, Rajiv Kumar <rajiv.kumar@gmail.com> wrote:
>
>> I wrote a little example[1] that has a bare-bones implementation of Go
>> style channels via a custom event loop. I used it to translate the prime
>> sieve example from Go[2] almost directly to Python. The code uses "message
>> = await channel.receive()" to mimic Go's "message <- channel". Instead of
>> using "go func()" to fire off a goroutine, I add the PEP492 coroutine to my
>> simple event loop.
>>
> Cool example!
>
> It's not an efficient implementation - really just a proof of concept that
>> you can use async/await in your own code without any reference to asyncio.
>> I ended up writing it as I was thinking about how PEP 342 style coroutines
>> might look like in an async/await world.
>>
>> In the course of writing this, I did find that it would be useful to have
>> the PEP document how event loops should advance the coroutines (via
>> .send(None) for example). It would also be helpful to have the semantics of
>> how await interacts with different kinds of awaitables documented. I had to
>> play with Yury's implementation to see what it does if the __await__ just
>> returns iter([1,2,3]) for example.
>>
> I've found this too. :-) Yury, perhaps you could show a brief example in
> the PEP of how to "drive" a coroutine from e.g. main()?

OK, will do!

Thanks,
Yury
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

1 2  View All