A modest PEP0238 suggestion
Guido van Rossum
guido at python.org
Wed Jul 25 01:12:17 EDT 2001
paul at svensson.org (Paul Svensson) writes:
(Thanks for your nice table, BTW.)
> The only choices that make sense to me here are, either we break stuff,
> or we do nothing. Either way, we'll most likely have to revisit the
> issue if/when syntax for rationals is to be added to the language.
Actually, adding rationals can be done almost entirely without
breaking code... That is, *if* we adopt PEP-238 now. Changing 1/2
from returning a float to returning a rational won't have to break
code, since the mathematical value of the result is the same.
Changing it from returning 0 to returning a rational isn't any easier
than changing it from returning 0 to returning a float -- exactly the
same places will have to be changed.
If you're for rationals, you're for PEP-238.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-list