Skip to content

Commit

Permalink
WIP: Add changelog and migration guide entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreichold committed Dec 24, 2023
1 parent 44ba7e7 commit 34d5fd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions guide/src/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Python::with_gil(|py| {
});
```

### `Python::allow_threads` was split into `Python::safe_allow_threads` and `Python::unsafe_allow_threads`

TODO

### `Iter(A)NextOutput` are deprecated

The `__next__` and `__anext__` magic methods can now return any type convertible into Python objects directly just like all other `#[pymethods]`. The `IterNextOutput` used by `__next__` and `IterANextOutput` used by `__anext__` are subsequently deprecated. Most importantly, this change allows returning an awaitable from `__anext__` without non-sensically wrapping it into `Yield` or `Some`. Only the return types `Option<T>` and `Result<Option<T>, E>` are still handled in a special manner where `Some(val)` yields `val` and `None` stops iteration.
Expand Down
1 change: 1 addition & 0 deletions newsfragments/3646.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`Python::allow_threads` now returns a builder-like object which allows choosing a strategy for running the closure, as the default one which now closes TLS-based soundness loopholes by dispatching the closure to a worker thread has significantly changed performance characteristics.

0 comments on commit 34d5fd6

Please sign in to comment.