From Python in a Nutshell
Custom Importers
An advanced, rarely needed functionality that Python offers is the ability to change the semantics of some or all import and from statements.
Rebinding __import__
You can rebind the
__import__
attribute of the modulebuiltin
to your own custom importer function—for example, one using the generic built-in-wrapping technique shown in “Python built-ins” on page 174.
In "You can rebind the
__import__
attribute of the modulebuiltin
", should "the modulebuiltin
" be "the modulebuiltins
" instead?Is "the
__import__
attribute of the modulebuiltin
" bound toimportlib.__import__
function by default? Or does "the modulebuiltin
" provide the default implementation bound to its__import__
attribute?