summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2020-03-02 08:57:27 (GMT)
committerGitHub <noreply@github.com>2020-03-02 08:57:27 (GMT)
commit9f1cb1bb49476246de5d9ed5fe680301cf7f7571 (patch)
tree953ef92261082834319b23e20eb8cfbd08d83b4a /Doc/library
parent28d0bcac8b7e6dbd28311f1283dabb6a4d649fcb (diff)
downloadcpython-9f1cb1bb49476246de5d9ed5fe680301cf7f7571.zip
cpython-9f1cb1bb49476246de5d9ed5fe680301cf7f7571.tar.gz
cpython-9f1cb1bb49476246de5d9ed5fe680301cf7f7571.tar.bz2
Fix misleading statement about mixed-type numeric comparisons (GH-18615)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/stdtypes.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 435ba5b..881c15d 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -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