diff options
| author | Gregory P. Smith <greg@krypto.org> | 2012-02-26 01:54:07 -0800 |
|---|---|---|
| committer | Gregory P. Smith <greg@krypto.org> | 2012-02-26 01:54:07 -0800 |
| commit | 3bbdc8e822b483fdfb66e0422e94630af10d1b80 (patch) | |
| tree | 2edbe9f8dac6fb0d6c3c92cfc86ed4c9f5476f24 | |
| parent | f527277b678b263b9d2f5ab52fb804fd1f62cde3 (diff) | |
| download | cpython-git-3bbdc8e822b483fdfb66e0422e94630af10d1b80.tar.gz | |
Issue #14123: Explicitly mention that old style % string formatting has caveats
but is not going away any time soon.
| -rw-r--r-- | Doc/library/stdtypes.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5f5d3b6ce7..153ee44cc9 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1437,8 +1437,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. |
