Skip to content

Commit 6d22dba

Browse files
lucmansrwgk
andauthored
Warning on comparing wrapper enums with is (#4732)
* Warning on comparing wrapper enums with is * backticks for quoting and link to related issue --------- Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>
1 parent b2732c6 commit 6d22dba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/classes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,3 +549,7 @@ The ``name`` property returns the name of the enum value as a unicode string.
549549
...
550550
551551
By default, these are omitted to conserve space.
552+
553+
.. warning::
554+
555+
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 commit comments

Comments
 (0)