The proposed PR optimizes "from ... import ..." from non-package modules. $ ./python -m perf timeit 'from locale import getlocale' Unpatched: Mean +- std dev: 811 ns +- 27 ns Patched: Mean +- std dev: 624 ns +- 17 ns Currently _bootstrap._handle_fromlist() is called which does nothing if the module is not a package, but adds an overhead of calling a Python function. The PR moves this check out of _handle_fromlist and avoid calling it if not needed.