bpo-38693: Use f-strings instead of str.format() within importlib by gpshead · Pull Request #17058 · python/cpython
added 2 commits
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. This could be backported to 3.8 as it changes no functionality. I kept `_ERR_MSG` as an attribute in `importlib._bootstrap` and `imp` as I wasn't sure if there were other things in the world that might refer to those. They're private and could go away in 3.9 but should not within 3.8 just in case.
gpshead
deleted the
minor-importlib-opts
branch
mpage pushed a commit to mpage/cpython that referenced this pull request
…thon#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters