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

nn pruebauno at latinmail.com
Wed May 22 15:49:51 EDT 2013


On May 22, 6:35 am, Skip Montanaro <s... at 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.




More information about the Python-list mailing list