New-style string formatting

Skip Montanaro skip at pobox.com
Wed May 21 08:54:40 EDT 2003


    Gerrit> So, where _does_ the % as string operator come from?

    Gerrit> My question was actually historic; what is the history of
    Gerrit> printf?  Does it come from C or is it older?

Don't know.

    >> [2] Aside: Would "..."(args) be more efficient than "..."%(args)?

    Gerrit> No, not at all...

I was thinking that the machinery necessary to decide how to execute

    left % right

would be avoided.  "..."(args) would cause the interpreter to check the
__call__ slot of the string object and call the target.

Skip





More information about the Python-list mailing list