Skip to content

0.5.0

Latest
Compare
Choose a tag to compare
@AndrejOrsula AndrejOrsula released this 09 May 21:53
· 8 commits to main since this release
64c64a5

What's Changed

  • Bumped pyo3 to 0.21, which includes a large transition to using pyo3::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 using Codegen::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

  1. Calling methods of class MyClass(pyo3::PyAny) encapsulated as pyo3::Bound<'_, MyClass> is now a bit more cumbersome. It requires that use 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 to arbitrary_self_types being unstable.
  2. Passing of ::pyo3::marker::Python<'py> is no longer necessary for methods. It is extracted from self directly.

Full Changelog: 0.4.0...0.5.0