On Mon, Aug 22, 2016, at 16:21, Malcolm Greene wrote: > Python 3.5: Is there a way to dynamically import specific names from a > module vs importing the full module? > > By dynamic I mean via some form of importlib machinery, eg. I'm looking > for the dynamic "from <module> import <name>" equivalent of "import > <module>"'s importlib.import_module.
You do know that "from <module> import <name>" still loads the whole module into sys.modules, right? And you're free to assign the result from importlib.import_module to a local variable and delete it once you've gotten the names you want out of it. -- https://mail.python.org/mailman/listinfo/python-list