
Hi All,
While I was reading the documentation of asyn generators, which shows the following example:
async def ticker(delay, to): """Yield numbers from 0 to *to* every *delay* seconds.""" for i in range(to): yield i await asyncio.sleep(delay)
It's came to my mind that it could could be simpler.
We could use just async yield
and all the other stuff could be done in the background.
Like if we use the yield in function, that function becomes a generator
example:
def my_async_generator(): for i in range(5):
async yield i
What do you think about this? Would this be feasible?
It doesn't appear to be any simpler. You just moved async from one
On Sat, 14 Sep 2019 at 16:26, George Fischhof <george@fischhof.hu> wrote: place to another. Therefore, change just for change sake, is pointless. In fact, more harm than pointless. -1
BR,
__george__
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/SRWW6U... Code of Conduct: http://python.org/psf/codeofconduct/
-- Gustavo J. A. M. Carneiro Gambit Research "The universe is always one step beyond logic." -- Frank Herbert