From 81931c7c537eef3c4da53feacafecf7d54414e64 Mon Sep 17 00:00:00 2001 From: mohsinm-dev Date: Sat, 8 Nov 2025 10:24:23 +0500 Subject: [PATCH 1/2] gh-141218: Fix inaccurate object comparison documentation Changed "Objects of different types, except different numeric types, never compare equal" to "Objects of different types, unless documented otherwise, never compare equal" to account for documented exceptions like set/frozenset comparisons. --- Doc/library/stdtypes.rst | 2 +- .../2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 97e7e08364e0bd..e329fe271b2ab4 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -164,7 +164,7 @@ This table summarizes the comparison operations: pair: object; numeric pair: objects; comparing -Objects of different types, except different numeric types, never compare equal. +Objects of different types, unless documented otherwise, never compare equal. The ``==`` operator is always defined but for some object types (for example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where they make sense; for example, they raise a diff --git a/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst b/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst new file mode 100644 index 00000000000000..78662ce0e2c0a8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst @@ -0,0 +1,4 @@ +Fix inaccurate documentation about object comparison. Changed "Objects of different +types, except different numeric types, never compare equal" to "Objects of different +types, unless documented otherwise, never compare equal" to account for documented +exceptions like set/frozenset comparisons. \ No newline at end of file From 37bb2829691d018e4e57ac19edd9bb479bd3f2ca Mon Sep 17 00:00:00 2001 From: mohsinm-dev Date: Sat, 8 Nov 2025 18:04:45 +0500 Subject: [PATCH 2/2] Remove news entry for documentation-only change --- .../2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst diff --git a/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst b/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst deleted file mode 100644 index 78662ce0e2c0a8..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2025-11-08-12-00-00.gh-issue-141218.kL3mNx.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix inaccurate documentation about object comparison. Changed "Objects of different -types, except different numeric types, never compare equal" to "Objects of different -types, unless documented otherwise, never compare equal" to account for documented -exceptions like set/frozenset comparisons. \ No newline at end of file