Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

Chris Angelico rosuav at gmail.com
Wed May 11 19:07:33 EDT 2016


On Thu, May 12, 2016 at 5:39 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> On Tuesday, May 10, 2016 at 8:16:43 PM UTC-4, Thomas 'PointedEars' Lahn wrote:
>> DFS wrote:
>>
>> > On 5/8/2016 8:44 PM, Thomas 'PointedEars' Lahn wrote:
>> >> With the “%” string operator (deprecated),
>> >
>> > according to who?
>>
>> TFM.
>>
>
> It's easy to be confused on this point.  Early on in the 3.x planning,
> there was talk of deprecating %-formatting.  It didn't happen, though.
>
> The docs have discussed it in a few different ways over the years.
>
> Python 3.0 and 3.1 said:
>
>     https://docs.python.org/3.1/library/stdtypes.html#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.
>
> 3.3 and up say:
>
>     https://docs.python.org/3.3/library/stdtypes.html#printf-style-string-formatting

Note also the change in the link: the current docs don't even call it
"old string formatting" any more; the two are perfectly parallel. But
at no point was percent formatting EVER deprecated, which is a very
specific technical term. As you say, there was talk of MAYBE
deprecating it.

ChrisA



More information about the Python-list mailing list