This release introduces a substantial new direction for PyO3's API. The Bound<'py, T>
smart pointer type has been added that replaces "GIL Refs" such as &'py PyAny
and &'py PyList
with smart-pointer forms Bound<'py, PyAny>
and Bound<'py, PyList>
. This new smart pointer brings ownership out of PyO3's internals and into user control. This has been done for sake of both performance and soundness.
The migration guide extensively details the intended transition to the new API. To allow users a more graceful upgrade path, PyO3 0.21 and 0.22 will maintain backwards compatibility support for the existing "GIL Refs" API.
As well as the Bound API, highlights of PyO3 0.21 include:
- Support for compiling for GraalPy
- Extended
chrono
/ datetime conversions, including support for theabi3
feature and thechrono-tz
crate - Simplifications to
__next__
and__anext__
methods
PyO3 0.21 also includes two new experimental features:
experimental-async
for a simpleasync fn
integration between Rust and Python.experimental-declarative-modules
for a new simpler#[pymodule]
syntax.
There have been numerous other smaller improvements, changes and fixes. For full details see the CHANGELOG.
Please consult the migration guide for help upgrading.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@acceptacross
@adamreichold
@aldanor
@alex
@alonme
@alxhill
@birkenfeld
@btel
@daemontus
@davidhewitt
@dmatos2012
@Hamatti
@Icxolu
@jadedpasta
@Jerry-Master
@jessekrubin
@Jgfrausing
@juntyr
@kushaldas
@LilyFoote
@maffoo
@mejrs
@messense
@mkovaxx
@neachdainn
@orhun
@samuelcolvin
@snuderl
@suriya-ganesh
@timfel
@Tpt
@wyfo
@Xuanwo