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

2013-05-22 Thread Carlos Nepomuceno
Ok. Thanks!

bugs.python.org/issue18031


 Date: Tue, 21 May 2013 23:26:58 -0400
 From: n...@nedbatchelder.com
 To: carlosnepomuc...@outlook.com
 CC: python-list@python.org
 Subject: Re: Myth Busters: % this old style of formatting will eventually be 
 removed from the language

 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.  
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-22 Thread Skip Montanaro
 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.

OTOH, PEP 3101 also mentions deprecation, at the very end: ... both
systems can co-exist until it comes time to deprecate the older
system.

I have been operating under the assumption since the days of that PEP
that %-style formatting would eventually disappear, dreading the day
when I'd have to learn the str.format language.  I apologize for
(inadvertently) spreading FUD.

It does seem like the documentation should be updated in a few places.
 If the decision has been made to not remove the older system, it
might be worthwhile to mention that somewhere.  Clearly the tutorial
and PEP 3101 should be updated.

Skip
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-22 Thread Denis McMahon
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, denismfmcma...@gmail.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-22 Thread Terry Jan Reedy

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


--
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-22 Thread nn
On May 22, 6:35 am, Skip Montanaro s...@pobox.com wrote:
  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.

 OTOH, PEP 3101 also mentions deprecation, at the very end: ... both
 systems can co-exist until it comes time to deprecate the older
 system.

 I have been operating under the assumption since the days of that PEP
 that %-style formatting would eventually disappear, dreading the day
 when I'd have to learn the str.format language.  I apologize for
 (inadvertently) spreading FUD.

 It does seem like the documentation should be updated in a few places.
  If the decision has been made to not remove the older system, it
 might be worthwhile to mention that somewhere.  Clearly the tutorial
 and PEP 3101 should be updated.

 Skip

I was of the impression that deprecating % was still planned for Py4k,
whenever that is. I personally believe that eliminating % formatting
would reduce bugs and generally make code clearer, but I realize that
breaking backward compatibility has a high price.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-21 Thread Carlos Nepomuceno
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
  
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-21 Thread Ethan Furman

On 05/21/2013 07: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?


It was exuberant wishful thinking.  ;)

While .format() does have its uses, % is in wide-spread use even among the 
core-devs.  It's not going away any time soon.

--
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-05-21 Thread Ned Batchelder

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.
--
http://mail.python.org/mailman/listinfo/python-list