Skip to content

Commit 9a8e078

Browse files
bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25055)
(cherry picked from commit fb1d01b) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com> Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
1 parent 138e039 commit 9a8e078

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)