summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2015-06-09 14:24:30 -0400
committerBarry Warsaw <barry@python.org>2015-06-09 14:24:30 -0400
commit97b6e98af37bd9c396302e0eb854456f52424df7 (patch)
tree370652874d2ee4e2a8e2c66e6999672cab324027
parent8203ba99ccb33ad66e803f795557e1133b1c1c28 (diff)
parent9380acbbf707d570696ab953489e62173e515b24 (diff)
downloadcpython-git-97b6e98af37bd9c396302e0eb854456f52424df7.tar.gz
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
-rw-r--r--Doc/library/string.rst14
-rw-r--r--Misc/NEWS6
2 files changed, 14 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index eab9f370f6..2bd8dfdc96 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -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}`` is equivalent to ``$identifier``. It is required when valid
- identifier characters follow the placeholder but are not part of the
+ ``"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
placeholder, such as ``"${noun}ification"``.
Any other appearance of ``$`` in the string will result in a :exc:`ValueError`
diff --git a/Misc/NEWS b/Misc/NEWS
index d29022a661..3fdda95150 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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?
==================================