Is it safe in Python to use 'from copy import copy' statement?
Question: 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?


Answer: 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:

    
    
    from myclass import MyClass
    from foo.bar.yourclass import YourClass
    

If this spelling causes local name clashes, then spell them

    
    
    import myclass
    import foo.bar.yourclass
    

and use "myclass.MyClass" and "foo.bar.yourclass.YourClass".

