How to implement asynchronous __anext__ method in new pyo3 version (0.21.0) #4064
Unanswered
chandr-andr
asked this question in
Questions
Replies: 1 comment
-
I've found one strange solution. I couldn't install So, now I can use Now it works, but looks a bit complicated. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! Thanks for the new version of Pyo3, It's awesome.
I want to understand how to implement the asynchronous
__anext__
method now.In your documentation https://pyo3.rs/main/migration.html#iteranextoutput-are-deprecated, you show an example with anext but there is no example with really asynchronous code.
Let's assume I need to write something like this:
As I understand
__anext__
method doesn't supportasync
construct and the docs said that it must return Pythonawaitable
, but__await__
or__iter__
methods also don't support async.The question is how can I expose asynchronous code in
__anext__
to Python?As there is no
pyo3_asyncio
withfuture_into_py
anymore, I'm a bit confused about how to implement such an idea.Beta Was this translation helpful? Give feedback.
All reactions