From acae5558e01024e4f6267b40d319d0f9714edab9 Mon Sep 17 00:00:00 2001 From: mejrs Date: Sun, 1 May 2022 22:41:12 +0200 Subject: [PATCH] Add to changelog and migration --- CHANGELOG.md | 2 ++ guide/src/migration.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e368a1f6f7..50de5db8c0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Implement `ToPyObject` for `[T; N]`. [#2313](https://github.com/PyO3/pyo3/pull/2313) +- Added the internal `IntoPyResult` trait to give better error messages when function return types do not implement `IntoPy`. [#2326](https://github.com/PyO3/pyo3/pull/2326) ### Changed - Move `PyTypeObject::type_object` method to `PyTypeInfo` trait, and deprecate `PyTypeObject` trait. [#2287](https://github.com/PyO3/pyo3/pull/2287) - The deprecated `pyproto` feature is now disabled by default. [#2322](https://github.com/PyO3/pyo3/pull/2322) - Deprecate `ToBorrowedObject` trait (it is only used as a wrapper for `ToPyObject`). [#2333](https://github.com/PyO3/pyo3/pull/2333) +- `impl IntoPy for [T; N]` now requires `T: IntoPy` rather than `T: ToPyObject`. [#2326](https://github.com/PyO3/pyo3/pull/2326) ## [0.16.4] - 2022-04-14 diff --git a/guide/src/migration.md b/guide/src/migration.md index 3aa50f7f218..66172fd1640 100644 --- a/guide/src/migration.md +++ b/guide/src/migration.md @@ -40,6 +40,10 @@ fn get_type_object(py: Python<'_>) -> &PyType { # Python::with_gil(|py| { get_type_object::(py); }); ``` +### `impl IntoPy for [T; N]` now requires `T: IntoPy` rather than `T: ToPyObject` + +If this leads to errors, simply implement `IntoPy`. Because pyclasses already implement `IntoPy`, you probably don't need to worry about this. + ## from 0.15.* to 0.16 ### Drop support for older technologies