diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-05-08 19:33:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 19:33:10 (GMT) |
commit | a0bd9e9c11f5f52c7ddd19144c8230da016b53c6 (patch) | |
tree | fff84d3ae52bfbf3b3e50779625c7b52b01d94b0 /Misc | |
parent | 6692dc1ca99fb34a19d0a4b93cf8e10619490001 (diff) | |
download | cpython-a0bd9e9c11f5f52c7ddd19144c8230da016b53c6.zip cpython-a0bd9e9c11f5f52c7ddd19144c8230da016b53c6.tar.gz cpython-a0bd9e9c11f5f52c7ddd19144c8230da016b53c6.tar.bz2 |
bpo-28307: Convert simple C-style formatting with literal format into f-string. (GH-5012)
C-style formatting with literal format containing only format codes
%s, %r and %a (with optional width, precision and alignment)
will be converted to an equivalent f-string expression.
It can speed up formatting more than 2 times by eliminating
runtime parsing of the format string and creating temporary tuple.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2021-05-08-19-54-57.bpo-28307.7ysaVW.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-05-08-19-54-57.bpo-28307.7ysaVW.rst b/Misc/NEWS.d/next/Core and Builtins/2021-05-08-19-54-57.bpo-28307.7ysaVW.rst new file mode 100644 index 0000000..86ac325 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-05-08-19-54-57.bpo-28307.7ysaVW.rst @@ -0,0 +1,3 @@ +Compiler now optimizes simple C-style formatting with literal format +containing only format codes %s, %r and %a by converting them to f-string +expressions. |