]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-28307: Convert simple C-style formatting with literal format into f-string. ...
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 May 2021 19:33:10 +0000 (22:33 +0300)
committerGitHub <noreply@github.com>
Sat, 8 May 2021 19:33:10 +0000 (22:33 +0300)
commita0bd9e9c11f5f52c7ddd19144c8230da016b53c6
treefff84d3ae52bfbf3b3e50779625c7b52b01d94b0
parent6692dc1ca99fb34a19d0a4b93cf8e10619490001
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.
Doc/whatsnew/3.11.rst
Misc/NEWS.d/next/Core and Builtins/2021-05-08-19-54-57.bpo-28307.7ysaVW.rst [new file with mode: 0644]
Python/ast_opt.c
Python/importlib_external.h