Could there be an alternative constructor which takes a function pointer as an argument?.P圜oro_New currently takes PyFrameObject for the first argument. I was wondering, how would Python core devs want these awaitable objects to be implemented? Some ideas:
To do this in a way that is agnostic to the async runtime (on either the Python or Rust side) I think any framework-level support in PyO3 for async fn will create Python callables which return awaitable objects. PyO3 (Rust bindings for Python) has a longstanding feature request for Rust’s async fn to be usable to make cross-language asynchronous code.