Re: [Python-Dev] PEP 525

2016-08-23 Thread Rajiv Kumar
Hi Yury, I was playing with your implementation to gain a better understanding of the operation of asend() and friends. Since I was explicitly trying to "manually" advance the generators, I wasn't using asyncio or other event loop. This meant that the first thing I ran into with my toy code was th

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

2015-05-07 Thread Rajiv Kumar
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

Re: [Python-Dev] async/await in Python; v2

2015-04-22 Thread Rajiv Kumar
I'd like to suggest another way around some of the issues here, with apologies if this has already been discussed sometime in the past. >From the viewpoint of a Python programmer, there are two distinct reasons for wanting to suspend execution in a block of code: 1. To yield a value from an itera