[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

Mark Dickinson report at bugs.python.org
Fri Jun 27 12:21:04 CEST 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

Trailing 'L's removed in r64557.

A couple more minor issues:

(1) fractions.gcd is exported but not documented.  I'll add some 
documentation for it, unless anyone feels that it shouldn't have been
exported in the first place.  If so, please speak up!

(2) The Fraction constructor is a little more lenient than it ought to 
be.  For example:

>>> Fraction('1.23', 1)
Fraction(123, 100)

I think this should really be a TypeError:  a second argument to the 
constructor should only be permitted when the first argument is an 
integer.  However, it seems fairly harmless, so I'm inclined to just 
leave this as it is and not mess with it.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1682>
_______________________________________


More information about the Python-bugs-list mailing list