You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-7Lines changed: 43 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@
17
17
18
18
> PyO3 Asyncio is a _brand new_ part of the broader PyO3 ecosystem. Feel free to open any issues for feature requests or bugfixes for this crate.
19
19
20
-
__If you're a new-comer, the best way to get started is to read through the primer below! For `v0.13` users I highly recommend reading through the [migration section](#migrating-from-013-to-014) to get a general idea of what's changed in `v0.14`.__
20
+
__If you're a new-comer, the best way to get started is to read through the primer below! For `v0.13`and `v0.14`users I highly recommend reading through the [migration section](#migration-guide) to get a general idea of what's changed in `v0.14` and `v0.15`.__
21
21
22
22
## PyO3 Asyncio Primer
23
23
@@ -142,7 +142,7 @@ use pyo3::{prelude::*, wrap_pyfunction};
- Managing event loop references can be tricky with pyo3-asyncio. See [Event Loop References](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/#event-loop-references) in the API docs to get a better intuition for how event loop references are managed in this library.
522
522
- Testing pyo3-asyncio libraries and applications requires a custom test harness since Python requires control over the main thread. You can find a testing guide in the [API docs for the `testing` module](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/testing)
523
523
524
-
## Migrating from 0.13 to 0.14
524
+
## Migration Guide
525
+
### Migrating from 0.13 to 0.14
525
526
526
527
So what's changed from `v0.13` to `v0.14`?
527
528
@@ -615,7 +616,42 @@ __Before you get started, I personally recommend taking a look at [Event Loop Re
615
616
-Replace `pyo3_asyncio::get_event_loop` with `pyo3_asyncio::<runtime>::get_current_loop`
-Anyinstanceof `cancellable_future_into_py` and `local_cancellable_future_into_py` conversionscanbereplacedwiththeir`future_into_py` and `local_future_into_py` counterparts.
-`scope` and `scope_local` variants now accept `TaskLocals` instead of `event_loop`. You can usually just replace the `event_loop` with `pyo3_asyncio::TaskLocals::new(event_loop).copy_context(py)?`.
653
+
- Return types for `future_into_py`, `future_into_py_with_locals``local_future_into_py`, and `local_future_into_py_with_locals` are now constrained by the bound `IntoPy<PyObject>` instead of requiring the return type to be `PyObject`. This can make the return types for futures more flexible, but inference can also fail when the concrete type is ambiguous (for example when using `into()`). Sometimes the `into()` can just be removed,
654
+
-`run`, and `run_until_complete` can now return any `Send + 'static` value.
0 commit comments