What's Changed
- Bumped
pyo3
to 0.21, which includes a large transition to usingpyo3::Bound
smart pointers (both internal and generated code). More information about breaking changes introduced by this change is mentioned below. - Function
pyo3_embed_python_source_code()
is now automatically generated when usingCodegen::module_from_str()
to simplify embedding of Python source code during runtime. - Removed
macros
from the default features - Added
numpy
feature for automatic mapping of numpy::ndarray
Significant API changes for the generated bindings due to pyo3
update to 0.21
- Calling methods of class
MyClass(pyo3::PyAny)
encapsulated aspyo3::Bound<'_, MyClass>
is now a bit more cumbersome. It requires thatuse MyClassMethods;
is included in the scope when such methods are used. This follows the API design of PyO3, where all methods are implemented under a trait (e.g.pyo3::types::PyAnyMethods
) due toarbitrary_self_types
being unstable. - Passing of
::pyo3::marker::Python<'py>
is no longer necessary for methods. It is extracted fromself
directly.
Full Changelog: 0.4.0...0.5.0