Skip to content

Commit

Permalink
Fix misleading statement about mixed-type numeric comparisons (GH-18615
Browse files Browse the repository at this point in the history
…) (GH-18737)

(cherry picked from commit 9f1cb1b)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
  • Loading branch information
miss-islington and mdickinson committed Mar 3, 2020
1 parent 852aee6 commit f8f163c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Doc/library/stdtypes.rst
Expand Up @@ -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
Expand Down
@@ -0,0 +1 @@
Fix misleading documentation about mixed-type numeric comparisons.

0 comments on commit f8f163c

Please sign in to comment.