- Issue #24351: Clarify what is meant by "identifier" in the context of

string.Template instances.
This commit is contained in:
Barry Warsaw 2015-06-09 14:24:30 -04:00
commit 97b6e98af3
2 changed files with 13 additions and 5 deletions

View File

@ -644,12 +644,14 @@ Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
* ``$$`` is an escape; it is replaced with a single ``$``.
* ``$identifier`` names a substitution placeholder matching a mapping key of
``"identifier"``. By default, ``"identifier"`` must spell a Python
identifier. The first non-identifier character after the ``$`` character
terminates this placeholder specification.
``"identifier"``. By default, ``"identifier"`` is restricted to any
case-insensitive ASCII alphanumeric string (including underscores) that
starts with an underscore or ASCII letter. The first non-identifier
character after the ``$`` character terminates this placeholder
specification.
* ``${identifier}`` is equivalent to ``$identifier``. It is required when valid
identifier characters follow the placeholder but are not part of the
* ``${identifier}`` is equivalent to ``$identifier``. It is required when
valid identifier characters follow the placeholder but are not part of the
placeholder, such as ``"${noun}ification"``.
Any other appearance of ``$`` in the string will result in a :exc:`ValueError`

View File

@ -13,6 +13,12 @@ Core and Builtins
Library
-------
Documentation
-------------
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
What's New in Python 3.5.0 beta 3?
==================================