Skip to content

Commit

Permalink
Add IntoPy<Py<PyString>> for &str to migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mejrs committed Apr 29, 2022
1 parent f1a926f commit 7e9385b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions guide/src/migration.md
Expand Up @@ -5,6 +5,33 @@ For a detailed list of all changes, see the [CHANGELOG](changelog.md).

## from 0.16.* to 0.17


### Added `impl IntoPy<Py<PyString>> for &str`

This may cause inference errors.

Before:
```rust,compile_fail
# use pyo3::prelude::*;
#
# fn main() {
Python::with_gil(|py| {
// Cannot infer either `Py<PyAny>` or `Py<PyString>`
let _test = "test".into_py(py);
});
# }
```

```rust
# use pyo3::prelude::*;
#
# fn main() {
Python::with_gil(|py| {
let _test: Py<PyAny> = "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.
Expand Down

0 comments on commit 7e9385b

Please sign in to comment.