mirror of
https://github.com/python/cpython
synced 2024-09-16 02:40:00 +00:00
bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (#25053)
This commit is contained in:
parent
af50c84643
commit
fb1d01b963
|
@ -188,8 +188,8 @@ Format String Syntax
|
|||
The :meth:`str.format` method and the :class:`Formatter` class share the same
|
||||
syntax for format strings (although in the case of :class:`Formatter`,
|
||||
subclasses can define their own format string syntax). The syntax is
|
||||
related to that of :ref:`formatted string literals <f-strings>`, but
|
||||
there are differences.
|
||||
related to that of :ref:`formatted string literals <f-strings>`, but it is
|
||||
less sophisticated and, in particular, does not support arbitrary expressions.
|
||||
|
||||
.. index::
|
||||
single: {} (curly brackets); in string formatting
|
||||
|
|
Loading…
Reference in a new issue