[Python-checkins] cpython (merge 3.5 -> default): - Issue #24351: Clarify what is meant by "identifier" in the context of
barry.warsaw
python-checkins at python.org
Tue Jun 9 20:24:45 CEST 2015
https://hg.python.org/cpython/rev/1cdedc9a9e9f
changeset: 96570:1cdedc9a9e9f
parent: 96567:38f75ebfe4cd
parent: 96569:0fa48f581fe3
user: Barry Warsaw <barry at python.org>
date: Tue Jun 09 14:24:30 2015 -0400
summary:
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
files:
Doc/library/string.rst | 12 +++++++-----
Misc/NEWS | 6 ++++++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -644,12 +644,14 @@
* ``$$`` 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`
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,12 @@
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?
==================================
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list