No complex rationals in Python 3.0

R

Rock

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.
 
R

Rock

Nobody has submitted a PEP and patch to implement the feature in time.
There is still Python 3.1, you know? If you like to contribute the
feature then please start a discussion on the Python Ideas mailing list
(not the developer lists!).


The code depends on the CLN library which isn't suited for the Python
core. It's written in C++ and it's licensed under GPL. Neither GPL nor
LGPL software can't be integrated into the core. We also require all
code to be compatible with C89.

Christian

Thanks Christian, will do so as soon as possible.

Rock
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top