[Python-checkins] Fix misleading statement about mixed-type numeric comparisons (GH-18615) (GH-18737)

Miss Islington (bot) webhook-mailer at python.org
Tue Mar 3 11:23:05 EST 2020


https://github.com/python/cpython/commit/f8f163c38f29e409b044e17afb01ca38485a7227
commit: f8f163c38f29e409b044e17afb01ca38485a7227
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-03-03T11:22:56-05:00
summary:

Fix misleading statement about mixed-type numeric comparisons (GH-18615) (GH-18737)

(cherry picked from commit 9f1cb1bb49476246de5d9ed5fe680301cf7f7571)

Co-authored-by: Mark Dickinson <dickinsm at gmail.com>

files:
A Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst
M Doc/library/stdtypes.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 5e9b59eb84bbb..c4c4ccd76d5a7 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -263,8 +263,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
index 0000000000000..b7a02522bbb1c
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst
@@ -0,0 +1 @@
+Fix misleading documentation about mixed-type numeric comparisons.



More information about the Python-checkins mailing list