diff options
author | Barry Warsaw <barry@python.org> | 2015-06-09 18:22:44 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-06-09 18:22:44 (GMT) |
commit | 9380acbbf707d570696ab953489e62173e515b24 (patch) | |
tree | ea276245e2c54fcbe83277919c8171c2d9bfea6d | |
parent | 86a60bfb08cd87f570b1330bfbd244ff2cb781f6 (diff) | |
parent | 17d5f474238fc753bf4d28d458784a0e2e6d3cd9 (diff) | |
download | cpython-9380acbbf707d570696ab953489e62173e515b24.zip cpython-9380acbbf707d570696ab953489e62173e515b24.tar.gz cpython-9380acbbf707d570696ab953489e62173e515b24.tar.bz2 |
- Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
-rw-r--r-- | Doc/library/string.rst | 14 | ||||
-rw-r--r-- | Misc/NEWS | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index eab9f37..2bd8dfd 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` @@ -45,6 +45,12 @@ Tests tp_finalize to avoid reference leaks encountered when combining tp_dealloc with PyType_FromSpec (see issue #16690 for details) +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 2? ================================== |