gh-132661: PEP 750 documentation: second pass (#137020)

This commit is contained in:
Adam Turner 2025-08-04 23:45:51 +02:00 committed by GitHub
parent c5cebe1b5a
commit 4dae9b1ff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 321 additions and 279 deletions

View file

@ -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