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

Aahz aahz at pythoncraft.com
Sun Aug 19 00:13:44 CEST 2007


On Thu, Aug 16, 2007, Guido van Rossum wrote:
>
> I don't know what percentage of %-formatting uses a string literal on
> the left; if it's a really high number (high 90s), I'd like to kill
> %-formatting and go with mechanical translation; otherwise, I think
> we'll have to phase out %-formatting in 3.x or 4.0.

Then there's the pseudo-literal for long lines:

    if not data:
        msg = "Syntax error at line %s: missing 'data' element"
        msg %= line_number

Including those, my code probably has quite a few non-literals.  Even
when you exclude them, going through and finding the non-literals will
cause much pain, because we do use "%" for numeric purposes and because
our homebrew templating language uses "%" to indicate a variable.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"And if that makes me an elitist...I couldn't be happier."  --JMS


More information about the Python-3000 mailing list