Is there a point to import as both wildcard and non-wildcard manner like:
import spam as sp
from spam import *
in the very same file?
When you import spam as sp, you make sure that there are no conflicts with other import commands:
import spam as sp
import myfunctions as my
sp.foo()
my.foo()
This is working as expected, but this isn't:
from spam import *
from myfunctions import *
foo()
foo() #Which foo() is meant? UNCLEAR!!!
When you avoid this problem by using import spam as sp, why would you want to use from spam import * anyways? I don't think there is any point in this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With