mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merged revisions 79455 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79455 | mark.dickinson | 2010-03-27 11:09:29 +0000 (Sat, 27 Mar 2010) | 2 lines Make Fraction to complex comparisons with <=, <, >= or > raise TypeError. ........
This commit is contained in:
parent
e6be10990d
commit
327f02c60c
2 changed files with 15 additions and 4 deletions
|
@ -526,8 +526,6 @@ class Fraction(numbers.Rational):
|
|||
if isinstance(other, numbers.Rational):
|
||||
return op(self._numerator * other.denominator,
|
||||
self._denominator * other.numerator)
|
||||
if isinstance(other, numbers.Complex) and other.imag == 0:
|
||||
other = other.real
|
||||
if isinstance(other, float):
|
||||
if math.isnan(other) or math.isinf(other):
|
||||
return op(0.0, other)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue