[Python-checkins] cpython (merge 3.2 -> default): Issue #14123: Explicitly mention that old style % string formatting has caveats

gregory.p.smith python-checkins at python.org
Sun Feb 26 10:54:56 CET 2012


http://hg.python.org/cpython/rev/98a1855ebfe1
changeset:   75294:98a1855ebfe1
parent:      75292:b299c4f31ff2
parent:      75293:80069bbae26d
user:        Gregory P. Smith <greg at krypto.org>
date:        Sun Feb 26 01:54:46 2012 -0800
summary:
  Issue #14123: Explicitly mention that old style % string formatting has caveats but is not going away any time soon.

files:
  Doc/library/stdtypes.rst |  9 +++++++--
  1 files changed, 7 insertions(+), 2 deletions(-)


diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1466,8 +1466,13 @@
 
 .. 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.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list