With the introduction of eager_task_factory in Python 3.12, I think it would be a good idea to start looking at populating the am_send slot whenever users implement the send() method.
But since this is a feature that is only available on Python 3.10+, we might have to gate it behind an attribute argument like so.
#[cfg_attr(Py_3_10, pyclass(fast_send))]
#[cfg_attr(not(Py_3_10), pyclass)]
struct Coroutine {
...
}
With the introduction of eager_task_factory in Python 3.12, I think it would be a good idea to start looking at populating the am_send slot whenever users implement the
send()method.But since this is a feature that is only available on Python 3.10+, we might have to gate it behind an attribute argument like so.