mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #25179: Documentation for formatted string literals aka f-strings
Some of the inspiration and wording is taken from the text of PEP 498 by Eric V. Smith, and the existing str.format() documentation.
This commit is contained in:
parent
e0b23095ee
commit
bc1ee460dc
10 changed files with 158 additions and 21 deletions
|
@ -25,7 +25,8 @@ first way is to do all the string handling yourself; using string slicing and
|
|||
concatenation operations you can create any layout you can imagine. The
|
||||
string type has some methods that perform useful operations for padding
|
||||
strings to a given column width; these will be discussed shortly. The second
|
||||
way is to use the :meth:`str.format` method.
|
||||
way is to use :ref:`formatted string literals <f-strings>`, or the
|
||||
:meth:`str.format` method.
|
||||
|
||||
The :mod:`string` module contains a :class:`~string.Template` class which offers
|
||||
yet another way to substitute values into strings.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue