Convert a pair of ints to a rational number, for internal use. The ratio of integers should be in lowest terms and the denominator should be positive.
(cls, numerator, denominator, /)
| 360 | |
| 361 | @classmethod |
| 362 | def _from_coprime_ints(cls, numerator, denominator, /): |
| 363 | """Convert a pair of ints to a rational number, for internal use. |
| 364 | |
| 365 | The ratio of integers should be in lowest terms and the denominator |
| 366 | should be positive. |
| 367 | """ |
| 368 | obj = super(Fraction, cls).__new__(cls) |
| 369 | obj._numerator = numerator |
| 370 | obj._denominator = denominator |
| 371 | return obj |
| 372 | |
| 373 | def is_integer(self): |
| 374 | """Return True if the Fraction is an integer.""" |