Mike Meyer wrote:
PEP: XXX
Title: A rational number module for Python
<snip>

I think it is a good idea to have rationals as part of the standard distribution but why not base this on the gmpy module (https://sourceforge.net/projects/gmpy)? That module already provides good performance. However, it does a few things that may not be good ideas.

1. Floats are converted to rationals. I think your proposal of rational to float is better.

2. Fails with a TypeError when used with a complex. Again Your proposal provides a better solution.

3. Fractional powers fail with a ValueError if the root is not exact. You do not address this in your proposal. Could silently convert to float in this case but is it better to force the user to be explicit and use the float() operation?

Ray Buvel
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to