From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 28 Mar 2021 21:05:07 +0000 (-0700) Subject: bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions... X-Git-Tag: v3.9.3~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1;p=thirdparty%2FPython%2Fcpython.git bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25055) (cherry picked from commit fb1d01b9630b5069fe975f16e07a027d90b89434) Co-authored-by: Irit Katriel Co-authored-by: Irit Katriel --- diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 54786d0c2ab0..e55884d28d63 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -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 `, but -there are differences. +related to that of :ref:`formatted string literals `, but it is +less sophisticated and, in particular, does not support arbitrary expressions. .. index:: single: {} (curly brackets); in string formatting