]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix misleading statement about mixed-type numeric comparisons (GH-18615)
authorMark Dickinson <mdickinson@enthought.com>
Mon, 2 Mar 2020 08:57:27 +0000 (08:57 +0000)
committerGitHub <noreply@github.com>
Mon, 2 Mar 2020 08:57:27 +0000 (08:57 +0000)
Doc/library/stdtypes.rst
Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst [new file with mode: 0644]

index 435ba5b74ff341072f05358f43e4c04c8e4383f0..881c15d8f7c5d1135bb0348bd001ae38abcc7b97 100644 (file)
@@ -261,8 +261,10 @@ and imaginary parts.
 Python fully supports mixed arithmetic: when a binary arithmetic operator has
 operands of different numeric types, the operand with the "narrower" type is
 widened to that of the other, where integer is narrower than floating point,
-which is narrower than complex.  Comparisons between numbers of mixed type use
-the same rule. [2]_ The constructors :func:`int`, :func:`float`, and
+which is narrower than complex. A comparison between numbers of different types
+behaves as though the exact values of those numbers were being compared. [2]_
+
+The constructors :func:`int`, :func:`float`, and
 :func:`complex` can be used to produce numbers of a specific type.
 
 All numeric types (except complex) support the following operations (for priorities of
diff --git a/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst b/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst
new file mode 100644 (file)
index 0000000..b7a0252
--- /dev/null
@@ -0,0 +1 @@
+Fix misleading documentation about mixed-type numeric comparisons.