Steve D'Aprano at 2016/11/16 8:33:23AM wrote:
> `import foo` imports the module foo, that is all. (To be pedantic: it is
> *nominally* a module. By design, it could be any object at all.)
> 
> `from foo import *` imports all the visible public attributes of foo.
> 
> They do completely different things, equivalent to something similar to:
> 
> five = int('5')
> 
> 
> versus:
> 
> 
> _tmp = int('5')
> for name in dir(_tmp):
>     if not name.startswith('_'):
>         locals()[name] = getattr(_tmp, name)
> del _tmp

This is far beyond my comprehension:-(

--Jach

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to