Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments.
Also, add bpo-12518 to the list of issues fixed by this PR.
  • Loading branch information
warsaw committed Mar 28, 2017
commit 2dcc1f4422bc3d5ca861f0547eb89ea3b32b7f83
14 changes: 8 additions & 6 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,11 @@ Template strings

Template strings provide simpler string substitutions as described in
:pep:`292`. The primary use case for template strings is for
internationalization (i18n) since in those contexts, the more featured yet
complex formatting languages for f-strings and ``str.format()`` can make
translations more difficult to implement. As an example of a library for i18n
built on template strings, see the `flufl.i18n
<http://flufli18n.readthedocs.io/en/latest/>`_ package.
internationalization (i18n) since in that context, the simpler syntax and
functionality makes it easier to translate than other built-in string
formatting facilities in Python. As an example of a library built on template
strings for i18n, see the
`flufl.i18n <http://flufli18n.readthedocs.io/en/latest/>`_ package.

Template strings support ``$``-based substitutions, using the following rules:

Expand Down Expand Up @@ -749,7 +749,9 @@ attributes:
* *delimiter* -- This is the literal string describing a placeholder
introducing delimiter. The default value is ``$``. Note that this should
*not* be a regular expression, as the implementation will call
:meth:`re.escape` on this string as needed.
:meth:`re.escape` on this string as needed. Note further that you cannot
change the delimiter after class creation (i.e. a different delimiter must
be set in the subclass's class namespace).

* *idpattern* -- This is the regular expression describing the pattern for
non-braced placeholders (the braces will be added automatically as
Expand Down
5 changes: 3 additions & 2 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,9 @@ C API
Documentation
-------------

- bpo-19824, bpo-20314: Improve the documentation for, and links to, template
strings, by emphasizing their utility for internationalization.
- bpo-19824, bpo-20314, bpo-12518: Improve the documentation for, and links
to, template strings by emphasizing their utility for internationalization,
and by clarifying some usage constraints.

- bpo-28929: Link the documentation to its source file on GitHub.

Expand Down