Python from import doesn’t save memory: The module still loads

Python from import doesn't save memory: The module still loads

Think “from modname import funcname” saves memory in Python? It doesn’t! (Lots of people think it does.)

The full module still loads (see sys.modules). The only difference: “modname” isn’t in your namespace, just “funcname”.

“from import” is convenient. It doesn’t save memory.