Skip to content

Commit f8f163c

Browse files
Fix misleading statement about mixed-type numeric comparisons (GH-18615) (GH-18737)
(cherry picked from commit 9f1cb1b) Co-authored-by: Mark Dickinson <[email protected]>
1 parent 852aee6 commit f8f163c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Doc/library/stdtypes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,10 @@ and imaginary parts.
263263
Python fully supports mixed arithmetic: when a binary arithmetic operator has
264264
operands of different numeric types, the operand with the "narrower" type is
265265
widened to that of the other, where integer is narrower than floating point,
266-
which is narrower than complex. Comparisons between numbers of mixed type use
267-
the same rule. [2]_ The constructors :func:`int`, :func:`float`, and
266+
which is narrower than complex. A comparison between numbers of different types
267+
behaves as though the exact values of those numbers were being compared. [2]_
268+
269+
The constructors :func:`int`, :func:`float`, and
268270
:func:`complex` can be used to produce numbers of a specific type.
269271

270272
All numeric types (except complex) support the following operations (for priorities of
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix misleading documentation about mixed-type numeric comparisons.

0 commit comments

Comments
 (0)