mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
gh-132661: PEP 750 documentation: second pass (#137020)
This commit is contained in:
parent
c5cebe1b5a
commit
4dae9b1ff1
8 changed files with 321 additions and 279 deletions
|
|
@ -95,11 +95,11 @@ Some examples::
|
|||
>>> repr((x, y, ('spam', 'eggs')))
|
||||
"(32.5, 40000, ('spam', 'eggs'))"
|
||||
|
||||
The :mod:`string` module also contains support for so-called
|
||||
:ref:`$-strings <template-strings-pep292>` that offer yet another way to
|
||||
substitute values into strings, using placeholders like ``$x`` and replacing
|
||||
them with values from a dictionary. This syntax is easy to use, although
|
||||
it offers much less control of the formatting.
|
||||
The :mod:`string` module contains support for a simple templating approach
|
||||
based upon regular expressions, via :class:`string.Template`.
|
||||
This offers yet another way to substitute values into strings,
|
||||
using placeholders like ``$x`` and replacing them with values from a dictionary.
|
||||
This syntax is easy to use, although it offers much less control for formatting.
|
||||
|
||||
.. index::
|
||||
single: formatted string literal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue