[Python-3000] [Python-Dev] Rounding Decimals
Jeffrey Yasskin
jyasskin at gmail.com
Mon Jan 14 01:26:34 CET 2008
On Jan 13, 2008 3:41 PM, Leif Walsh <adlaiff6 at gmail.com> wrote:
> I haven't been watching the python-dev list for very long, so maybe
> this has already been discussed ad nauseam (in which case, sorry),
> but, from the devil's advocate-ish mathematics side of things, unless
> numbers.Decimal is planned to be implemented with infinite precision
> (which I doubt, but could not confirm with an admittedly small amount
> of research), shouldn't it implement numbers.Rational instead? Was
> this ever discussed, or was it just assumed that numbers.Real was the
> right decision?
Guido mentioned the possibility briefly at
http://mail.python.org/pipermail/python-3000/2007-April/007015.html
("One could argue that float and Decimal are <:Q, but I'm not sure if
that makes things better pragmatically") but never really discussed as
far as I can find (although I did think about it :). I prefer having
float not implement Rational (Decimal's off the table) because
developers usually think of them as approximations to arbitrary,
possibly-irrational, real numbers, rather than as rational numbers
with some odd constraints on their denominators. That is, to me, the
ABCs a type implements are more about how developers should think
about the type than the implementation of the type.
[ A new thread is probably appropriate if anyone wants to discuss the
philosophy, but I probably won't participate... ]
--
Namasté,
Jeffrey Yasskin
More information about the Python-3000
mailing list