File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,18 @@ interactive Python session demonstrating this example is shown below:
58
58
Static member functions can be bound in the same way using
59
59
:func: `class_::def_static `.
60
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
+
61
73
.. note ::
62
74
63
75
Binding C++ types in unnamed namespaces (also known as anonymous namespaces)
You can’t perform that action at this time.
0 commit comments