summaryrefslogtreecommitdiffstats
path: root/Lib/fractions.py
Commit message (Collapse)AuthorAgeFilesLines
* The __all__ variable forgot to expose the gcd() function.Raymond Hettinger2008-05-081-1/+1
|
* Change simple instances (in Fraction) of self.numerator and self.denominator toJeffrey Yasskin2008-02-141-28/+28
| | | | | | self._numerator and self._denominator. This speeds abs() up from 12.2us to 10.8us and trunc() from 2.07us to 1.11us. This doesn't change _add and friends because they're more complicated.
* Performance optimizations on Fraction's constructor.Jeffrey Yasskin2008-02-141-11/+9
| | | | | | | | | | | ./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3)` 31.7 usec/loop -> 9.2 usec/loop ./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3, 2)'` 27.7 usec/loop -> 9.32 usec/loop ./python.exe -m timeit -s 'from fractions import Fraction; f = Fraction(3, 2)' 'Fraction(f)' 31.9 usec/loop -> 14.3 usec/loop
* Revert change in r60712: turn alternate constructors back intoMark Dickinson2008-02-121-13/+13
| | | | classmethods instead of staticmethods.
* Implementation of Fraction.limit_denominator.Mark Dickinson2008-02-121-34/+52
| | | | | Remove Fraction.to_continued_fraction and Fraction.from_continued_fraction
* Put an extra space into the repr of a Fraction:Mark Dickinson2008-02-111-1/+1
| | | | Fraction(1, 2) instead of Fraction(1,2).
* Rename rational.Rational to fractions.Fraction, to avoid name clashMark Dickinson2008-02-101-0/+520
with numbers.Rational. See issue #1682 for related discussion.