[issue41756] Do not always use exceptions to return result from coroutine

Mark Shannon report at bugs.python.org
Mon Sep 21 06:50:10 EDT 2020


Mark Shannon <mark at hotpy.org> added the comment:

Yury,

Why was the PR merged with a new API function `PyGen_Send`?

I explicitly said that any new API function should *not* start with `PyGen`, nor should any function rely on generators and async "coroutines" sharing the same memory layout.

If you disagree with me, please say why, don't just merge the PR.

The name `PyGen` is misleading as it can handle coroutines as well as generators.
There is no performance advantage to only handling these two types.
Worse, it requires that a `PyCoroObject` can always be cast to a `PyGenObject`, preventing better layout of either object in the future.


Would you revert the PR, please.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41756>
_______________________________________


More information about the Python-bugs-list mailing list