We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
py::native_enum
1 parent c630e22 commit 4457195Copy full SHA for 4457195
1 file changed
docs/classes.rst
@@ -583,6 +583,13 @@ The older ``py::enum_`` is not PEP 435 compatible
583
but remains supported indefinitely for backward compatibility.
584
New bindings should prefer ``py::native_enum``.
585
586
+.. important::
587
+
588
+ The enum types created by ``py::native_enum`` are native Python types, while
589
+ the enum types created by the older ``py::enum_`` are C++ pybind11 types.
590
+ Developers **SHOULD NOT** call ``PyType_*`` Python C APIs on the enum types
591
+ created by ``py:native_enum``.
592
593
.. note::
594
595
The deprecated ``py::enum_`` is :ref:`documented here <deprecated_enum>`.
0 commit comments