This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: The Python Tutorial says % string formatting will be removed
Type: enhancement Stage:
Components: Documentation Versions: Python 3.3, Python 3.4, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Carlos.Nepomuceno, docs@python, eric.smith, ezio.melotti, loewis, nedbat, python-dev
Priority: normal Keywords:

Created on 2013-05-22 05:58 by Carlos.Nepomuceno, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg189791 - (view) Author: Carlos Nepomuceno (Carlos.Nepomuceno) Date: 2013-05-22 05:58
It[1] says:
"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."

msg189795 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2013-05-22 07:42
Can you please provide some context for this report?

On the abstract, I agree that there is an error in the tutorial: it is not decided whether the % formatting will be eventually removed, and I would also personally disagree with the recommendation to prefer .format.
msg189802 - (view) Author: Carlos Nepomuceno (Carlos.Nepomuceno) Date: 2013-05-22 10:01
According to what I have been told at str.__mod__() is not going to be deprecated and that seems to be a myth created by Python's own documentation.

I do remember to have read previously in another page that it would be deprecated but that seems to be already corrected. Today I just found it in the tutorial.
msg189826 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2013-05-22 17:26
I agree that we should not say that %-formatting will be removed from the language. Not until Python 5000, anyway.
msg189852 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-23 07:12
New changeset ef037ad304c1 by Raymond Hettinger in branch '2.7':
Issue #18031:  %-formatting isn't dead yet and might pull through.
msg189853 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-23 07:15
New changeset e1d6140b02f0 by Raymond Hettinger in branch '3.3':
Issue #18031:  %-formatting isn't dead yet and might pull through.
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62231
2013-05-23 07:16:04rhettingersetstatus: open -> closed
resolution: fixed
2013-05-23 07:15:47python-devsetmessages: + msg189853
2013-05-23 07:12:45python-devsetnosy: + python-dev
messages: + msg189852
2013-05-22 17:26:55eric.smithsetnosy: + eric.smith
messages: + msg189826
2013-05-22 11:16:56nedbatsetnosy: + nedbat
2013-05-22 10:01:01Carlos.Nepomucenosetmessages: + msg189802
2013-05-22 07:42:44loewissetnosy: + loewis
messages: + msg189795
2013-05-22 06:32:10ezio.melottisetnosy: + ezio.melotti

type: enhancement
versions: + Python 3.3, Python 3.4
2013-05-22 05:58:22Carlos.Nepomucenocreate