PyO3 v0.9.0 Release Notes

Release Date: 2020-03-19 // about 4 years ago
  • ๐Ÿš€ This is a big release and there are some breaking changes.
    Please check the migration guide.

    Thank you @ijl @birkenfeld @Alexander-N @davidhewitt @konstin @c410-f3r @oconnor663 @andrewwhitehead @synapticarbors @bmatthieu3 @Hywan @paddywwoof for contributing!
    And thank you all bug reporters and reviewers, though it's difficult to list them here.

    ๐Ÿ”„ Changed

    • #[new] does not take PyRawObject and can return Self. #683
    • The blanket implementations for FromPyObject for &T and &mut T are no longer specializable. Implement PyTryFrom for your type to control the behavior of FromPyObject::extract() for your types. #713
    • The implementation for IntoPy<U> for T where U: FromPy<T> is no longer specializable. Control the behavior of this via the implementation of FromPy. #713
    • ๐Ÿ‘‰ Use parking_lot::Mutex instead of spin::Mutex. #734
    • โฌ†๏ธ Bumped minimum Rust version to 1.42.0-nightly 2020-01-21. #761
    • PyRef and PyRefMut are renewed for PyCell. #770
    • Some new FFI functions for Python 3.8. #784
    • PyAny is now on the top level module and prelude. #816

    โž• Added

    • PyCell, which has RefCell-like features. #770
    • PyClass, PyLayout, PyClassInitializer. #683
    • Implemented IntoIterator for PySet and PyFrozenSet. #716
    • ๐Ÿ‘ฏ FromPyObject is now automatically implemented for T: Clone pyclasses. #730
    • #[pyo3(get)] and #[pyo3(set)] will now use the Rust doc-comment from the field for the Python property. #755
    • #[setter] functions may now take an argument of Pyo3::Python. #760
    • PyTypeInfo::BaseLayout and PyClass::BaseNativeType. #770
    • PyDowncastImpl. #770
    • Implement FromPyObject and IntoPy<PyObject> traits for arrays (up to 32). #778
    • migration.md and types.md in the guide. #795, #802
    • ffi::{_PyBytes_Resize, _PyDict_Next, _PyDict_Contains, _PyDict_GetDictPtr}. #820

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed unsoundness of subclassing. #683.
    • ๐Ÿ‘ป Clear error indicator when the exception is handled on the Rust side. #719
    • Usage of raw identifiers with #[pyo3(set)]. #745
    • Usage of PyObject with #[pyo3(get)]. #760
    • #[pymethods] used in conjunction with #[cfg]. #769
    • "*" in a #[pyfunction()] argument list incorrectly accepting any number of positional arguments (use args = "*" when this behaviour is desired). #792
    • PyModule::dict. #809
    • ๐Ÿ›  Fix the case where DESCRIPTION is not null-terminated. #822

    โœ‚ Removed

    • PyRawObject. #683
    • PyNoArgsFunction. #741
    • initialize_type(). To set the module name for a #[pyclass], use the module argument to the macro. #751
    • AsPyRef::as_mut/with/with_mut/into_py/into_mut_py. #770
    • PyTryFrom::try_from_mut/try_from_mut_exact/try_from_mut_unchecked. #770
    • Python::mut_from_owned_ptr/mut_from_borrowed_ptr. #770
    • ObjectProtocol::get_base/get_mut_base. #770