From: Xiang Zhang Date: Wed, 13 Jun 2018 02:37:54 +0000 (+0800) Subject: [2.7] bpo-33828: Clarify auto-numbering is not available to string.Formatter. (GH... X-Git-Tag: v2.7.16rc1~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc8ea20c6f8571de96791bc5f7f2d693406024c7;p=thirdparty%2FPython%2Fcpython.git [2.7] bpo-33828: Clarify auto-numbering is not available to string.Formatter. (GH-7668) (GH-7676) string.Formatter auto-numbering feature was added in 3.4 and not available in 2.7. Make the documentation unambiguous. --- diff --git a/Doc/library/string.rst b/Doc/library/string.rst index c2af446619e3..2293b022c26a 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -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::