diff options
Diffstat (limited to 'Lib/fractions.py')
-rw-r--r-- | Lib/fractions.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/fractions.py b/Lib/fractions.py index 75c7df14e1..4302f3f1b9 100644 --- a/Lib/fractions.py +++ b/Lib/fractions.py @@ -225,6 +225,10 @@ class Fraction(numbers.Rational): (cls.__name__, dec, type(dec).__name__)) return cls(*dec.as_integer_ratio()) + def is_integer(self): + """Return True if the Fraction is an integer.""" + return self._denominator == 1 + def as_integer_ratio(self): """Return the integer ratio as a tuple. |