Python has complicated namespaces and modules notion, so i unsure about this. Normally python module and something that is imported from it has different names or only module is imported and it’s content used by fully qualified name:
import copy # will use copy.copy
from time import localtime # "localtime" has different name from "time".
But what if module has same name as something that i’m importing from it? For example:
from copy import copy
copy( "something" )
Is it safe? Maybe it’s some complicated consequences that i can’t see?
From PEP8 ( http://www.python.org/dev/peps/pep-0008/#imports):
When importing a class from a class-containing module, it’s usually okay to spell this:
If this spelling causes local name clashes, then spell them
and use “myclass.MyClass” and “foo.bar.yourclass.YourClass”.