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 <rwgk@google.com>
This commit is contained in:
Luc de Jonckheere 2023-07-12 17:56:40 +02:00 committed by GitHub
parent b2732c6e1a
commit 6d22dba82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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. 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).