On Thu, Feb 18, 2021 at 3:57 PM Luciano Ramalho <luci...@ramalho.org> wrote:
> <DISCLAIMER>I am not a Python core developer, but my question relates > to changes that are expected in Python 3.10, so I felt this was the > best forum to ask. Please let me know if I should discuss this > elsewhere or file a documentation bug.</DISCLAIMER> > > First of all, thank you Yuri Selivanov and everybody who contributed > to the overhaul of the asyncio docs which are now much better > organized. > > In the process of updating "Fluent Python" to cover Python 3.9, I > learned that the "Generator-based coroutines" section in the asyncio > docs warns that "Support for generator-based coroutines is deprecated > and is scheduled for removal in Python 3.10." [1] > > [1] > https://docs.python.org/3/library/asyncio-task.html#generator-based-coroutines > > I don't understand that warning, given that PEP 492 lists as one of > the awaitable types: > > * A generator-based coroutine object returned from a function > decorated with types.coroutine(). > > Perhaps what is going to be removed is support for old style > generator-based coroutines decorated with @asyncio.coroutine, or not > decorated (which historically also worked)? > > I'd appreciate some clarification on exactly what is going to be removed. > Reading the doc section you link to, it's pretty clear that `@asyncio.coroutine` will be removed. The fact that it's mentioned in PEP 492 is irrelevant -- there is no rule that says we can't evolve Python to invalidate APIs specified in past PEPs, as long as the deprecation process is followed (which it is in this case). > Maybe we also need updates to the Glossary [2] to bridge the gap > between our previous use of the word "coroutine" (as in PEP 342) and > the way we are using it today, when we are not being explicit about > "native coroutines". In particular, the Glossary has no entry at all > for "generator-based coroutine"—those marked with @types.coroutine. > > [2] https://docs.python.org/3/glossary.html > Why would it require a glossary entry? It's right there in the first link you give as the section header. And it's an outmoded concept (which was clear from the moment 'async def' was invented). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/RN4U56FFWSKOGBFA2ZZ7EADDRLF2E644/ Code of Conduct: http://python.org/psf/codeofconduct/