Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 82e7692

Browse filesBrowse files
[3.11] gh-72971: Clarify the special no-TypeError behavior for equality (GH-110729) (#116255)
(cherry picked from commit 67f742e) Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
1 parent 9485566 commit 82e7692
Copy full SHA for 82e7692

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎Doc/reference/datamodel.rst

Copy file name to clipboardExpand all lines: Doc/reference/datamodel.rst
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,12 +1788,15 @@ Basic customization
17881788
rather, :meth:`__lt__` and :meth:`__gt__` are each other's reflection,
17891789
:meth:`__le__` and :meth:`__ge__` are each other's reflection, and
17901790
:meth:`__eq__` and :meth:`__ne__` are their own reflection.
1791-
If the operands are of different types, and right operand's type is
1791+
If the operands are of different types, and the right operand's type is
17921792
a direct or indirect subclass of the left operand's type,
17931793
the reflected method of the right operand has priority, otherwise
17941794
the left operand's method has priority. Virtual subclassing is
17951795
not considered.
17961796

1797+
When no appropriate method returns any value other than :data:`NotImplemented`, the
1798+
``==`` and ``!=`` operators will fall back to ``is`` and ``is not``, respectively.
1799+
17971800
.. method:: object.__hash__(self)
17981801

17991802
.. index::

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.