Re: Problem with coroutines old-style / new-style usage and features

2018-02-01 Thread Yahya Abou 'Imran via Python-list
>> @asyncio.coroutine >> def recorder(): >> dialog = [] >> while True: >> sent = yield dialog >> if sent is not None: >> name, things = sent >> dialog.append(f'{name} says : {things}') >This is not an asyncio coroutine. This is just a normal generator that > you're sending to. So you should probabl

Re: Problem with coroutines old-style / new-style usage and features

2018-02-01 Thread Ian Kelly
On Thu, Feb 1, 2018 at 5:38 AM, Yahya Abou 'Imran via Python-list wrote: > Hi guys. > > I am discovering coroutines and asynchronous programming, and I have a little > problem with a little example I'm coding myself as an excercice. > > Let say you take two guys in the street: Dave and Bryan. > Y

Problem with coroutines old-style / new-style usage and features

2018-02-01 Thread Yahya Abou 'Imran via Python-list
Hi guys. I am discovering coroutines and asynchronous programming, and I have a little problem with a little example I'm coding myself as an excercice. Let say you take two guys in the street: Dave and Bryan. You ask dave to count from 1 to 50, 1 by 1. He will do it fast. And you ask Bryan to co