mirror of
https://github.com/python/cpython
synced 2024-09-16 02:49:57 +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
|
The :meth:`str.format` method and the :class:`Formatter` class share the same
|
||||||
syntax for format strings (although in the case of :class:`Formatter`,
|
syntax for format strings (although in the case of :class:`Formatter`,
|
||||||
subclasses can define their own format string syntax). The syntax is
|
subclasses can define their own format string syntax). The syntax is
|
||||||
related to that of :ref:`formatted string literals <f-strings>`, but
|
related to that of :ref:`formatted string literals <f-strings>`, but it is
|
||||||
there are differences.
|
less sophisticated and, in particular, does not support arbitrary expressions.
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
single: {} (curly brackets); in string formatting
|
single: {} (curly brackets); in string formatting
|
||||||
|
|
Loading…
Reference in a new issue