]> granicus.if.org Git - python/commitdiff
- Issue #24351: Clarify what is meant by "identifier" in the context of
authorBarry Warsaw <barry@python.org>
Tue, 9 Jun 2015 18:20:31 +0000 (14:20 -0400)
committerBarry Warsaw <barry@python.org>
Tue, 9 Jun 2015 18:20:31 +0000 (14:20 -0400)
  string.Template instances.

Doc/library/string.rst
Misc/NEWS

index f9da5fa7ad85b8cf582472ce2d81fbe8e8ed4206..19bdb21b3e5925a610b41bf7d7da488adc71ba17 100644 (file)
@@ -640,12 +640,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`
index dada469adfbd5cd40a9bd3f8028e751eff8bd3df..b2f49600ac25393607456c0c6e2542aabcc68132 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -323,6 +323,9 @@ C API
 Documentation
 -------------
 
+- Issue #24351: Clarify what is meant by "identifier" in the context of
+  string.Template instances.
+
 - Issue #22155: Add File Handlers subsection with createfilehandler to tkinter
   doc.  Remove obsolete example from FAQ.  Patch by Martin Panter.