Unexpected results comparing float to Fraction

Chris Angelico rosuav at gmail.com
Thu Aug 1 05:48:40 EDT 2013


On Thu, Aug 1, 2013 at 10:44 AM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> The real dividing line between {int, Fraction} and {float, Decimal,
> complex} is about (in)exactness. The numeric tower ensures the
> property that inexactness is contagious which I think is a good thing.

*nods slowly*

That does make sense, albeit a little oddly. So when you're sorting
out different integer sizes (C's short/int/long, Py2's int/long), you
go to the "better" one, but when working with inexact types, you go to
the "worse" one. But I can see the logic in it.

ChrisA



More information about the Python-list mailing list