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

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Feb 25 01:23:41 CET 2012


On 24/02/2012 21:37, "Martin v. Löwis" wrote:
>> I was of the thought that Old String Formatting |"%s" % foo| was to be
>> phased out by Advanced String Formatting |"{}.format(foo)|.
>
> This is actually not the case, and never was. Some people would indeed
> like to see that happen, and others are strongly opposed.
>
> As a consequence, both APIs for formatting will coexist for a long time
> to come (ten years at least); no deprecation is planned.
>
> Regards,
> Martin

<quote>
Quoting the docs http://docs.python.org/py3k/library/stdtypes.html

4.6.2. Old String Formatting Operations

Note

The formatting operations described here are obsolete and may go away in 
future versions of Python. Use the new String Formatting in new code.

</quote>

I think this is daft because all of the code has to be supported for the 
ten years that MVL has suggested.  I suggest a plan that says something 
like:-

Until Python 3.5 both methods of string formatting will be supported.
In Python 3.6 the the old formating style will be deprecated.
In Python 3.7 the old style is dead.

I'm fully aware that it isn't likely to be that easy, I'm simply trying 
to spark ideas from the core developers and users who are in a far 
better situation to judge this situation than I am.

-- 
Cheers.

Mark Lawrence.



More information about the Python-Dev mailing list