Skip to content

Commit 7318d76

Browse files
committed
Add a note in docs/classes.rst
1 parent b2b6663 commit 7318d76

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: docs/classes.rst

+11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ interactive Python session demonstrating this example is shown below:
5858
Static member functions can be bound in the same way using
5959
:func:`class_::def_static`.
6060

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+
Please see
69+
`#4319 <https://github.com/pybind/pybind11/pull/5015>`_
70+
for more background.
71+
6172
.. note::
6273

6374
Binding C++ types in unnamed namespaces (also known as anonymous namespaces)

0 commit comments

Comments
 (0)