Skip to content

deprecated Pybind11 enum support

Context

Following Pybind11 documentation:

py::native_enum was introduced with pybind11v3. It binds C++ enum types to native Python enum types, typically types in Python’s stdlib enum module, which are PEP 435 compatible. This is the recommended way to bind C++ enums. The older py::enum_ is not PEP 435 compatible (see issue #2332) but remains supported indefinitely for backward compatibility. New bindings should prefer py::native_enum.

I suggest to upgrade Pybind11 version from v2.13.6 to v3.0.1.

3.0.0 was a major update providing support for py::native_enum as well as better support for std::unique_ptr

It is compatible with python >= 3.10, CMake > 3.15 and C++ >= 14

It also seems to have a better handling of containers, which should help to create a Tensor constructor from multi-dims array.

I strongly advocate for