How about adding rational fraction to Python?

Dan Bishop danb_83 at yahoo.com
Wed Feb 27 21:46:39 EST 2008


On Feb 26, 11:21 pm, Mark Dickinson <dicki... at gmail.com> wrote:
> On Feb 26, 11:55 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
>
> > So use:  return sum(number_list) / float(len(number_list))
> > That makes it somewhat more explicit what you want.  Otherwise
>
> But that fails for a list of Decimals...
>
> Mark

Or complex.  Or for rationals if you aren't expecting a conversion to
float.



More information about the Python-list mailing list