[Python-3000] PEP 3101 suggested corrections

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 27 00:06:32 CEST 2007


Chris Monson wrote:
>         'd' - Decimal Integer. Outputs the number in base 10.
> 
> Modern C now has
> 'i' as an alternative to 'd'

Considering that in printf formats the alternatives to
'd' or 'i' are 'x' for hexadecimal and 'o' for octal,
then 'd' for decimal makes a lot more sense to me than
'i', which says nothing about the base in which it
will be displayed.

It makes even more sense in Python, where the format
codes are clearly all about the display format and
nothing to do with the type of data (whereas the
distinction is somewhat blurred in C).

 > most people expect decimals to have fractional parts).

Then their expectations require adjustment. "Decimal"
means "base 10". On its own it doesn't imply anything
about fractions.

--
Greg


More information about the Python-3000 mailing list