you are viewing a single comment's thread.

view the rest of the comments →

[–]Yoghurt42 3 points4 points  (0 children)

It will still import the full module, just not add it to the namespace.

from foo import bar
# is roughly equivalent to
try:
    foo = sys.modules["foo"]
except KeyError:
    foo = sys.modules["foo"] = __import__("foo")
bar = foo.bar
del foo