Commit 9380acbb authored by Barry Warsaw's avatar Barry Warsaw

- Issue #24351: Clarify what is meant by "identifier" in the context of

  string.Template instances.
parents 86a60bfb 17d5f474
...@@ -644,12 +644,14 @@ Instead of the normal ``%``\ -based substitutions, Templates support ``$``\ ...@@ -644,12 +644,14 @@ Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
* ``$$`` is an escape; it is replaced with a single ``$``. * ``$$`` is an escape; it is replaced with a single ``$``.
* ``$identifier`` names a substitution placeholder matching a mapping key of * ``$identifier`` names a substitution placeholder matching a mapping key of
``"identifier"``. By default, ``"identifier"`` must spell a Python ``"identifier"``. By default, ``"identifier"`` is restricted to any
identifier. The first non-identifier character after the ``$`` character case-insensitive ASCII alphanumeric string (including underscores) that
terminates this placeholder specification. starts with an underscore or ASCII letter. The first non-identifier
character after the ``$`` character terminates this placeholder
* ``${identifier}`` is equivalent to ``$identifier``. It is required when valid specification.
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"``. placeholder, such as ``"${noun}ification"``.
Any other appearance of ``$`` in the string will result in a :exc:`ValueError` Any other appearance of ``$`` in the string will result in a :exc:`ValueError`
......
...@@ -45,6 +45,12 @@ Tests ...@@ -45,6 +45,12 @@ Tests
tp_finalize to avoid reference leaks encountered when combining tp_dealloc tp_finalize to avoid reference leaks encountered when combining tp_dealloc
with PyType_FromSpec (see issue #16690 for details) 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? What's New in Python 3.5.0 beta 2?
================================== ==================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment