Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45704 > unrolled thread

Re: Myth Busters: % "this old style of formatting will eventually be removed from the language"

Started byNed Batchelder <ned@nedbatchelder.com>
First post2013-05-21 23:26 -0400
Last post2013-05-22 15:40 -0400
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Myth Busters: % "this old style of formatting will eventually be removed from the language" Ned Batchelder <ned@nedbatchelder.com> - 2013-05-21 23:26 -0400
    Re: Myth Busters: % "this old style of formatting will eventually be removed from the language" Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-22 14:24 +0000
      Re: Myth Busters: % "this old style of formatting will eventually be removed from the language" Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-22 15:40 -0400

#45704 — Re: Myth Busters: % "this old style of formatting will eventually be removed from the language"

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-05-21 23:26 -0400
SubjectRe: Myth Busters: % "this old style of formatting will eventually be removed from the language"
Message-ID<mailman.1949.1369193229.3114.python-list@python.org>
On 5/21/2013 10:26 PM, Carlos Nepomuceno wrote:
> I was looking for something else and just found what I think is the place where I was first exposed to the myth[1]:
>
> "Since str.format() is quite new, a lot of Python code still uses the % operator. However, because this old style of formatting will eventually be removed from the language, str.format() should generally be used."
>
> Is this tutorial outdated or this still an issue?
>
> [1] http://docs.python.org/2/tutorial/inputoutput.html#old-string-formatting 		 	   		

That tutorial is out of date.  %-formatting isn't being removed.

--Ned.

[toc] | [next] | [standalone]


#45736

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-05-22 14:24 +0000
Message-ID<knike3$v6m$2@dont-email.me>
In reply to#45704
On Tue, 21 May 2013 23:26:58 -0400, Ned Batchelder wrote:

> On 5/21/2013 10:26 PM, Carlos Nepomuceno wrote:

>> "Since str.format() is quite new, a lot of Python code still uses the %
>> operator. However, because this old style of formatting will eventually
>> be removed from the language, str.format() should generally be used."

>> Is this tutorial outdated or this still an issue?

> That tutorial is out of date.  %-formatting isn't being removed.

Indeed, removing %-formatting could break a substantial amount of live 
code, with potentially significant maintenance effort in the user 
community simply to make existing code work with the new interpreter. The 
effect of this on corporations using python code translates into 
"business risk", and the next step is "we can avoid the business risk by 
migrating our python scripts to some other language."

For the designers and maintainers of any language to arbitrarily[1] (in 
the eyes of the user base) remove a widely used feature that would have a 
major effect on the user base could kill off a language, simply because 
many users will not want to take the risk of it happening again, even if 
they can easily automate the upgrade from removed obsolete language 
feature to new shiny language feature.

[1] Some portion of the user base will always consider any such change 
that causes them headaches and additional effort as having been 
arbitrary, no matter how well the language designers and maintainers 
explain the need to break the old scripts.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#45744

FromTerry Jan Reedy <tjreedy@udel.edu>
Date2013-05-22 15:40 -0400
Message-ID<mailman.1973.1369251634.3114.python-list@python.org>
In reply to#45736
On 5/22/2013 10:24 AM, Denis McMahon wrote:

> Indeed, removing %-formatting could break a substantial amount of live
> code, with potentially significant maintenance effort in the user

While I would like to see % formatting go away everntually*, other 
developers would not. In any case, I agree that it should not disappear 
until there is a foolproof conversion tool, probably custom written. I 
am working on other things.

* perhaps in 10 years?, when all 2.x code that is going to be converted 
has been converted

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web