Skip to content

Commit

Permalink
Warning on comparing wrapper enums with is (#4732)
Browse files Browse the repository at this point in the history
* Warning on comparing wrapper enums with is

* backticks for quoting and link to related issue

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
  • Loading branch information
lucmans and rwgk committed Jul 12, 2023
1 parent b2732c6 commit 6d22dba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,7 @@ The ``name`` property returns the name of the enum value as a unicode string.
...
By default, these are omitted to conserve space.

.. warning::

Contrary to Python customs, enum values from the wrappers should not be compared using ``is``, but with ``==`` (see `#1177 <https://github.com/pybind/pybind11/issues/1177>`_ for background).

0 comments on commit 6d22dba

Please sign in to comment.