How about adding rational fraction to Python?

Lie Lie.1296 at
Sat Feb 16 21:03:37 CET 2008

On Feb 17, 2:26 am, Mark Dickinson <dicki... at> wrote:
> On Feb 16, 1:35 pm, Lie <Lie.1... at> wrote:
> > Would all these problems with floating points be a rational reason to
> > add rational numbers support in Python or Py3k? (pun not intended)
> It's already in the trunk!  Python will have a rational type (called
> Fraction) in Python 2.6 and Python 3.0, thanks largely to the work of
> Jeffrey Yaskin.
> Mark

Really? I didn't know that (last time I checked they frowned at me for
asking that). It's going to be be great if Python supports fractional
number. Although rationals have its limitations too, it is a much
better choice compared to floats/Decimals for most cases. One thing
though, the time I've spent on creating a rational class myself would
be 'somewhat' wasted, although I don't really mind that since it was
fun in any case.

More information about the Python-list mailing list