[Python-3000] Draft PEP for Requiring Lowercase Literal Modifiers

Andrew McCollum mccollum at fas.harvard.edu
Tue Mar 20 04:59:40 CET 2007


> And float()?  Will this break?
>
> In [9]: float('%E' % 3e-10)
> Out[9]: 3e-10

I don't see any compelling reason to break this behavior.  Also, float is
different in that it already has special handling for values such as "Inf"
and "NaN" (even if they are inconsistent across platforms), and makes no
claim to follow the eval behavior, instead defining itself in terms of the
underlying C library.

> Changes like this don't do much for me.  Sure, lowercase modifiers are
> prettier, but why remove the general functionality and leave in a few
> special cases, especially when functionality to display numbers in
> those formats exists?

It seems like your main objection is to the change disallowing the "0X"
prefix when a 0 radix is passed to int, which is the only functionality
suggested for removal by this PEP.  I think there are legitimate arguments
on both sides, which is why this is listed as the major open issue.

I'm curious, how many people even use the autobase functionality.  Google
Codesearch turns up only a few hits (around 26, by my count), many of which
are in the Python test suite itself.  Most of the rest seem to be cases
where the base of the number is in fact known, but the 0 radix is used
anyway, perhaps out of laziness.

	-Andrew McCollum



More information about the Python-3000 mailing list