[Python-ideas] Python Float Update

drekin at gmail.com drekin at gmail.com
Wed Jun 3 16:29:47 CEST 2015


Stephen J. Turnbull writes:

> Nick Coghlan writes:
>
> > the main concern I have with [a FloatLiteral that carries the
> > original repr around] is that we'd be trading the status quo for a
> > situation where "Decimal(1.3)" and "Decimal(13/10)" gave different
> > answers.
>
> Yeah, and that kills the deal for me.  Either Decimal is the default
> representation for non-integers, or this is a no-go.  And that isn't
> going to happen.

What if also 13/10 yielded a fraction? Anyway, what are the objections to integer division returning a fraction? They are coerced to floats when mixed with them. Also, the repr of Fraction class could be altered so repr(13 / 10) == "13 / 10" would hold.

Regards, Drekin



More information about the Python-ideas mailing list