Skip to content

Commit 9f1cb1b

Browse files
authored
Fix misleading statement about mixed-type numeric comparisons (GH-18615)
1 parent 28d0bca commit 9f1cb1b

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
@@ -261,8 +261,10 @@ and imaginary parts.
261261
Python fully supports mixed arithmetic: when a binary arithmetic operator has
262262
operands of different numeric types, the operand with the "narrower" type is
263263
widened to that of the other, where integer is narrower than floating point,
264-
which is narrower than complex. Comparisons between numbers of mixed type use
265-
the same rule. [2]_ The constructors :func:`int`, :func:`float`, and
264+
which is narrower than complex. A comparison between numbers of different types
265+
behaves as though the exact values of those numbers were being compared. [2]_
266+
267+
The constructors :func:`int`, :func:`float`, and
266268
:func:`complex` can be used to produce numbers of a specific type.
267269

268270
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)