8000 bpo-31907: [doc] clarify that str.format() does not support arbitrary… · python/cpython@fb1d01b · GitHub
[go: up one dir, main page]

Skip to content

Commit fb1d01b

Browse files
authored
bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (#25053)
1 parent af50c84 commit fb1d01b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/string.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ Format String Syntax
188188
The :meth:`str.format` method and the :class:`Formatter` class share the same
189189
syntax for format strings (although in the case of :class:`Formatter`,
190190
subclasses can define their own format string syntax). The syntax is
191-
related to that of :ref:`formatted string literals <f-strings>`, but
192-
there are differences.
191+
related to that of :ref:`formatted string literals <f-strings>`, but it is
192+
less sophisticated and, in particular, does not support arbitrary expressions.
193193

194194
.. index::
195195
single: {} (curly brackets); in string formatting

0 commit comments

Comments
 (0)
0