We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2b6663 commit cf230fbCopy full SHA for cf230fb
docs/classes.rst
@@ -58,6 +58,18 @@ interactive Python session demonstrating this example is shown below:
58
Static member functions can be bound in the same way using
59
:func:`class_::def_static`.
60
61
+.. note::
62
+
63
+ By default pybind11 uses a custom metaclass which is known to be
64
+ incompatible with
65
+ `abc.ABCMeta <https://docs.python.org/3/library/abc.html#abc.ABCMeta>`_
66
+ and can also lead to other surprising issues. In such cases,
67
+ using ``py::metaclass(PyType_Type)`` is often a good solution
68
+ (e.g. ``py::class_<Pet>(m, "Pet", py::metaclass(PyType_Type))``).
69
+ Please see
70
+ `#5015 <https://github.com/pybind/pybind11/pull/5015>`_
71
+ for more background.
72
73
.. note::
74
75
Binding C++ types in unnamed namespaces (also known as anonymous namespaces)
0 commit comments