]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38693: Use f-strings instead of str.format() within importlib (#17058)
authorGregory P. Smith <greg@krypto.org>
Thu, 6 Oct 2022 23:43:16 +0000 (16:43 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Oct 2022 23:43:16 +0000 (16:43 -0700)
commit683ab859554c34831fcecc854de35745d7fd603c
tree9327b84ceba87d1c8be5ada8ce7497489c14b444
parent21a2d9ff550977f2668e2cf1cc15793bf27fa109
bpo-38693: Use f-strings instead of str.format() within importlib (#17058)

This is a small performance improvement, especially for one or two hot
places such as _handle_fromlist() that are called a lot and the
.format() method was being used just to join two strings with a dot.

Otherwise it is merely a readability improvement.

We keep `_ERR_MSG` and `_ERR_MSG_PREFIX` as those may be used elsewhere for canonical looking error messages.
Lib/importlib/_bootstrap.py
Misc/NEWS.d/next/Library/2019-11-04-22-21-27.bpo-38693.w_OAov.rst [new file with mode: 0644]
Python/importlib.h [new file with mode: 0644]