diff --git a/guide/src/migration.md b/guide/src/migration.md index 3aa50f7f218..bd9f53e5581 100644 --- a/guide/src/migration.md +++ b/guide/src/migration.md @@ -5,6 +5,35 @@ For a detailed list of all changes, see the [CHANGELOG](changelog.md). ## from 0.16.* to 0.17 + +### Added `impl IntoPy> for &str` + +This may cause inference errors. + +Before: +```rust,compile_fail +# use pyo3::prelude::*; +# +# fn main() { +Python::with_gil(|py| { + // Cannot infer either `Py` or `Py` + let _test = "test".into_py(py); +}); +# } +``` + +After, some type annotations may be necessary: + +```rust +# use pyo3::prelude::*; +# +# fn main() { +Python::with_gil(|py| { + let _test: Py = "test".into_py(py); +}); +# } +``` + ### The `pyproto` feature is now disabled by default In preparation for removing the deprecated `#[pyproto]` attribute macro in a future PyO3 version, it is now gated behind an opt-in feature flag. This also gives a slight saving to compile times for code which does not use the deprecated macro.