summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-02-26 09:54:46 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-02-26 09:54:46 (GMT)
commitc45a8a153bf20515060c2056308b46caccd959e0 (patch)
tree5740bf685939ca6f6f4c77b0683953c33f36e1d6 /Doc
parentab7bf2143e67ddc1510413fa0d7f9c621adf22fa (diff)
parent3bbdc8e822b483fdfb66e0422e94630af10d1b80 (diff)
downloadcpython-c45a8a153bf20515060c2056308b46caccd959e0.zip
cpython-c45a8a153bf20515060c2056308b46caccd959e0.tar.gz
cpython-c45a8a153bf20515060c2056308b46caccd959e0.tar.bz2
Issue #14123: Explicitly mention that old style % string formatting has caveats but is not going away any time soon.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/stdtypes.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 1526a0a..ce83757 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1466,8 +1466,13 @@ Old String Formatting Operations
.. note::
- The formatting operations described here are obsolete and may go away in future
- versions of Python. Use the new :ref:`string-formatting` in new code.
+ The formatting operations described here are modelled on C's printf()
+ syntax. They only support formatting of certain builtin types. The
+ use of a binary operator means that care may be needed in order to
+ format tuples and dictionaries correctly. As the new
+ :ref:`string-formatting` syntax is more flexible and handles tuples and
+ dictionaries naturally, it is recommended for new code. However, there
+ are no current plans to deprecate printf-style formatting.
String objects have one unique built-in operation: the ``%`` operator (modulo).
This is also known as the string *formatting* or *interpolation* operator.