On Sat, Nov 25, 2017 at 1:05 PM, David Mertz <me...@gnosis.cx> wrote:
> FWIW, on a side point. I use 'yield' and 'yield from' ALL THE TIME in real > code. Probably 80% of those would be fine with yield statements, but a > significant fraction use `gen.send()`. > > On the other hand, I have yet once to use 'await', or 'async' outside of > pedagogical contexts. There are a whole lot of generators, including ones > utilizing state injection, that are useful without the scaffolding of an > event loop, in synchronous code. > Maybe you didn't realize async/await don't need an event loop? Driving an async/await-based coroutine is just as simple as driving a yield-from-based one (`await` does exactly the same thing as `yield from`). But I won't argue with the usefulness of `yield [from]` in expressions. That is not the topic of this thread. > Of course, I never use them in comprehensions or generator expressions. > And even after reading every post in this thread, the behavior (either > existing or desired by some) such constructs have is murky and difficult > for me to reason about. I strongly support deprecation or even just > immediate SyntaxError in 3.7. > Maybe the rest of the discussion should be about deprecation vs. SyntaxError in Python 3.7. -- --Guido van Rossum (python.org/~guido)
_______________________________________________ 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