On Apr 16, 2015 1:52 AM, "Danny Yoo" <danny....@gmail.com> wrote:
>
>
> On Apr 16, 2015 1:32 AM, "Jim Mooney" <cybervigila...@gmail.com> wrote:
> >
> > Why does Fraction interpret a number and string so differently? They
come
> > out the same, but it seems rather odd
> >
> > >>> from fractions import Fraction
> > >>> Fraction(1.64)
> > Fraction(7385903388887613, 4503599627370496)
> > >>> Fraction("1.64")
> > Fraction(41, 25)
> > >>> 41/25
> > 1.64
> > >>> 7385903388887613 / 4503599627370496
> > 1.64
>
> In many systems, if everything is the same shape, then certain operations
might be implemented more quickly by making uniform assumptions.  If all my
clothes were the same, for example, maybe I'd be able to sorry my laundry
more quickly.  And if all my Tupperware were the same size, then maybe my
cabinets wouldn't be the nest of ill fitting plastic that it is now.

Substitute "sorry" with "sort".  Sorry!  :p
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to