Skip to content

Commit f4ca829

Browse files
author
Stefan Behnel
committed
special case int/long in richcmp()
1 parent 23c6c1c commit f4ca829

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/quicktions.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,9 @@ cdef class Fraction:
597597
598598
"""
599599
# convert other to a Rational instance where reasonable.
600-
if isinstance(other, (int, long, Fraction, Rational)):
600+
if isinstance(other, (int, long)):
601+
return op(self._numerator, self._denominator * other)
602+
if isinstance(other, (Fraction, Rational)):
601603
return op(self._numerator * other.denominator,
602604
self._denominator * other.numerator)
603605
if isinstance(other, float):

0 commit comments

Comments
 (0)