[Python-ideas] Complex rationals in Python.

Guido van Rossum guido at python.org
Mon Nov 24 21:22:36 CET 2008

It's way too late in the 3.0 release cycle, but feel free to submit a
patch for inclusion into 2.7 and 3.1.

On Mon, Nov 24, 2008 at 12:01 PM, Rocco Orlando Rossi
<rocco.rossi at gmail.com> wrote:
> I appreciate the inclusion of the fractions module in Python 2.6 and
> therefore in Python 3.0. But I feel there's something missing: no
> possibility for complex rationals (or arbitrary precision) integers. I
> was just checking the complex number support in Python, compared, for
> instance, to Common Lisp and Scheme, and I realized that there was
> this subtle omission. The inclusion of rationals and arbitrary
> integers is cool, but the numeric tower (say, compared to Scheme) is
> not complete. I don't think there would be a performance hit if
> complex rationals were provided. Ordinary operations on complex
> floats, in theory, should not be affected and handled separately. But
> it would be nice to be able to do:
> (3/4 + 1/2j) * (1/4 - j) = 11/16 - 5/8j
> with no loss of precision.
> Python is heavily used in math and science all over the world. We've
> even got a recent symbolic math project (sympy) that looks very
> promising, so I guess this could be an important issue.
> Note: there exists a library that implements what I'm talking about:
> http://calcrpnpy.sourceforge.net/clnum.html
> but still I personally would have liked to see this stuff included
> natively in the new Python 3.0.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-ideas mailing list