]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-33828: Clarify auto-numbering is not available to string.Formatter. (GH... 5581/head
authorXiang Zhang <angwerzx@126.com>
Wed, 13 Jun 2018 02:37:54 +0000 (10:37 +0800)
committerGitHub <noreply@github.com>
Wed, 13 Jun 2018 02:37:54 +0000 (10:37 +0800)
string.Formatter auto-numbering feature was added in 3.4 and not
available in 2.7. Make the documentation unambiguous.

Doc/library/string.rst

index c2af446619e31d46e147be0c0850337c4ad7adc0..2293b022c26a0d75ba5b41bc77f967c074f418dc 100644 (file)
@@ -257,8 +257,9 @@ attribute using :func:`getattr`, while an expression of the form ``'[index]'``
 does an index lookup using :func:`__getitem__`.
 
 .. versionchanged:: 2.7
-   The positional argument specifiers can be omitted, so ``'{} {}'`` is
-   equivalent to ``'{0} {1}'``.
+   The positional argument specifiers can be omitted for :meth:`str.format` and
+   :meth:`unicode.format`, so ``'{} {}'`` is equivalent to ``'{0} {1}'``,
+   ``u'{} {}'`` is equivalent to ``u'{0} {1}'``.
 
 Some simple format string examples::