Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97b6e98

Browse files
committed
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
2 parents 8203ba9 + 9380acb commit 97b6e98

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

Doc/library/string.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,14 @@ Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
644644
* ``$$`` is an escape; it is replaced with a single ``$``.
645645

646646
* ``$identifier`` names a substitution placeholder matching a mapping key of
647-
``"identifier"``. By default, ``"identifier"`` must spell a Python
648-
identifier. The first non-identifier character after the ``$`` character
649-
terminates this placeholder specification.
650-
651-
* ``${identifier}`` is equivalent to ``$identifier``. It is required when valid
652-
identifier characters follow the placeholder but are not part of the
647+
``"identifier"``. By default, ``"identifier"`` is restricted to any
648+
case-insensitive ASCII alphanumeric string (including underscores) that
649+
starts with an underscore or ASCII letter. The first non-identifier
650+
character after the ``$`` character terminates this placeholder
651+
specification.
652+
653+
* ``${identifier}`` is equivalent to ``$identifier``. It is required when
654+
valid identifier characters follow the placeholder but are not part of the
653655
placeholder, such as ``"${noun}ification"``.
654656

655657
Any other appearance of ``$`` in the string will result in a :exc:`ValueError`

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Core and Builtins
1313
Library
1414
-------
1515

16+
Documentation
17+
-------------
18+
19+
- Issue #24351: Clarify what is meant by "identifier" in the context of
20+
string.Template instances.
21+
1622

1723
What's New in Python 3.5.0 beta 3?
1824
==================================

0 commit comments

Comments
 (0)