[Python-checkins] bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25055)
ericvsmith
webhook-mailer at python.org
Sun Mar 28 17:05:17 EDT 2021
https://github.com/python/cpython/commit/9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1
commit: 9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ericvsmith <ericvsmith at users.noreply.github.com>
date: 2021-03-28T17:05:07-04:00
summary:
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 <iritkatriel at yahoo.com>
Co-authored-by: Irit Katriel <iritkatriel at yahoo.com>
files:
M Doc/library/string.rst
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 54786d0c2ab0d..e55884d28d633 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 <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
More information about the Python-checkins
mailing list