[Python-3000] Please don't kill the % operator...

Georg Brandl g.brandl at gmx.net
Thu Aug 16 14:58:08 CEST 2007


skip at pobox.com schrieb:
>     Alex> The PEP abstract says this proposal will replace the '%' operator,
> 
> I hope this really doesn't happen.  printf-style formatting has a long
> history both in C and Python and is well-understood.  Its few limitations
> are mostly due to the binary nature of the % operator, not to the power or
> flexibility of the format strings themselves.  In contrast, the new format
> "language" seems to have no history (is it based on features in other
> languages?  does anyone know if it will actually be usable in common
> practice?) and at least to the casual observer of recent threads on this
> topic seems extremely baroque.
> 
> Python has a tradition of incorporating the best ideas from other languages.
> String formatting is so common that it doesn't seem to me we should need to
> invent a new, unproven mechanism to do this.

Not to mention the pain of porting %-style format strings and % formatting
to {}-style format strings and .format() in Py3k.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-3000 mailing list