Skip to content

Commit

Permalink
[2.7] bpo-33828: Clarify auto-numbering is not available to string.Fo…
Browse files Browse the repository at this point in the history
…rmatter. (GH-7668) (GH-7676)

string.Formatter auto-numbering feature was added in 3.4 and not
available in 2.7. Make the documentation unambiguous.
  • Loading branch information
zhangyangyu committed Jun 13, 2018
1 parent 42ca836 commit fc8ea20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Doc/library/string.rst
Expand Up @@ -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::

Expand Down

0 comments on commit fc8ea20

Please sign in to comment.