[Python-Dev] Status regarding Old vs. Advanced String Formating

Benjamin Peterson benjamin at python.org
Fri Feb 24 17:41:31 CET 2012


2012/2/24 Tshepang Lekhonkhobe <tshepang at gmail.com>:
> Hi,
>
> I was of the thought that Old String Formatting |"%s" % foo| was to be
> phased out by Advanced String Formatting |"{}.format(foo)|. I however
> keep seeing new code committed into the main VCS using the old style.
> Is this okay? Is there a policy? I ask also because I expect CPython
> to lead by example.

Using either is fine I think. It doesn't hurt anyone to have old
string formatting around for a long time. In general, +0 for using new
string formatting.

>
> On another note, will the old format ever be deprecated? Is there a date?

I doubt it.


-- 
Regards,
Benjamin


More information about the Python-Dev mailing list