Mark Shannon <m...@hotpy.org> added the comment:

I agree with Serhiy, that `PyGen_` is a bad prefix.

Unless a function takes generator objects and *only* generators objects, then 
it shouldn't have a `PyGen` prefix.

The API function is the C equivalent of obj.send(val).
The first parameter is an object.

Coroutines do not inherit from generators.
That the the C implementations are so coupled is an unfortunate historical 
accident, and may well be changed.

Regardless of how this is implemented internally, any API function's signature 
should reflect the equivalent Python code.
And please use an enum, not an int, as the return value. It's a huge boon for 
readability.

I would suggest:
`PySendResult PyIter_Send(PyObject *obj, PyObject *arg, PyObject **result);`

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to