summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@gmail.com>2008-01-15 07:46:24 (GMT)
committerJeffrey Yasskin <jyasskin@gmail.com>2008-01-15 07:46:24 (GMT)
commitd7b00334f3cbf7a802e875238b9f2bd95e190436 (patch)
tree0324043740339278109491f3c7afef3be6b1a425 /Python/Python-ast.c
parentca9c6e433c6637352eecbe3432786a1ae9bec1de (diff)
downloadcpython-d7b00334f3cbf7a802e875238b9f2bd95e190436.zip
cpython-d7b00334f3cbf7a802e875238b9f2bd95e190436.tar.gz
cpython-d7b00334f3cbf7a802e875238b9f2bd95e190436.tar.bz2
Add rational.Rational as an implementation of numbers.Rational with infinite
precision. This has been discussed at http://bugs.python.org/issue1682. It's useful primarily for teaching, but it also demonstrates how to implement a member of the numeric tower, including fallbacks for mixed-mode arithmetic. I expect to write a couple more patches in this area: * Rational.from_decimal() * Rational.trim/approximate() (maybe with different names) * Maybe remove the parentheses from Rational.__str__() * Maybe rename one of the Rational classes * Maybe make Rational('3/2') work.
Diffstat (limited to 'Python/Python-ast.c')
0 files changed, 0 insertions, 0 deletions