diff --git a/pep-0690.rst b/pep-0690.rst index 6e638d9ec..2c2b8d656 100644 --- a/pep-0690.rst +++ b/pep-0690.rst @@ -231,6 +231,17 @@ a list of module names within which all imports will be eager:: The effect of this is also shallow: all imports within ``one.mod`` will be eager, but not imports in all modules imported by ``one.mod``. +``set_eager_imports()`` can also take a callback which receives a module name and returns +whether imports within this module should be eager:: + + import re + from importlib import set_eager_imports + + def eager_imports(name): + return re.match(r"foo\.[^.]+\.logger", name) + + set_eager_imports(eager_imports) + Backwards Compatibility =======================