Commit 0ee04208 authored by Stefan Behnel's avatar Stefan Behnel

Mention Py_EQ and friends in __richcmp__() docs.

parent c372d2db
......@@ -132,19 +132,22 @@ There are no separate methods for the individual rich comparison operations
:meth:`__richcmp__` which takes an integer indicating which operation is to be
performed, as follows:
+-----+-----+
| < | 0 |
+-----+-----+
| == | 2 |
+-----+-----+
| > | 4 |
+-----+-----+
| <= | 1 |
+-----+-----+
| != | 3 |
+-----+-----+
| >= | 5 |
+-----+-----+
+-----+-----+-------+
| < | 0 | Py_LT |
+-----+-----+-------+
| == | 2 | Py_EQ |
+-----+-----+-------+
| > | 4 | Py_GT |
+-----+-----+-------+
| <= | 1 | Py_LE |
+-----+-----+-------+
| != | 3 | Py_NE |
+-----+-----+-------+
| >= | 5 | Py_GE |
+-----+-----+-------+
The named constants can be cimported from the ``cpython.object`` module.
They should generally be preferred over plain integers to improve readabilty.
The :meth:`__next__` method
----------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment