On Wed, Nov 22, 2017 at 6:46 PM, Ivan Levkivskyi <levkivs...@gmail.com> wrote: [..] > Just found another example of intuitive behaviour: > >>>> async def f(): > ... for i in range(3): > ... yield i > ... >>>> async def g(): > ... return [(yield i) async for i in f()] > ... >>>> g().send(None) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "<stdin>", line 2, in g > TypeError: object async_generator can't be used in 'await' expression > > of course it is obvious for anyone who writes async code, but anyway an > interesting example.
I wouldn't say that it's obvious to anyone... I think this thread has started to discuss the use of 'yield' expression in comprehensions, and the outcome of the discussion is that everyone thinks that we should deprecate that syntax in 3.7, remove in 3.8. Let's start with that? :) 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/archive%40mail-archive.com