Skip to content

Commit

Permalink
Add a note in docs/classes.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Feb 1, 2024
1 parent b2b6663 commit dfe3eac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ interactive Python session demonstrating this example is shown below:
Static member functions can be bound in the same way using
:func:`class_::def_static`.

.. note::

By default pybind11 uses a custom metaclass which is known to be
incompatible with
`abc.ABCMeta <https://docs.python.org/3/library/abc.html#abc.ABCMeta>`_
and can also lead to other surprising issues. In such cases,
using ``py::metaclass(PyType_Type)`` is often a good solution.
Please see
`#5015 <https://github.com/pybind/pybind11/pull/5015>`_
for more background.

.. note::

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

0 comments on commit dfe3eac

Please sign in to comment.