[EMAIL PROTECTED] writes:
> file1.py
> --
> a = 20
> from abc import *
> print "Should this be printed when 'a' is alone imported from this
> module"
>
> file2.py
> --
> from file1 import a
> print a
>
> file2.py is used in a context where 'from abc import *' statement
> doesn't
On Jun 13, 5:52 pm, [EMAIL PROTECTED] wrote:
> file1.py
> --
> a = 20
> from abc import *
> print "Should this be printed when 'a' is alone imported from this
> module"
>
> file2.py
> --
> from file1 import a
> print a
>
> (snipped)
>
> Of course, the option of using if __name__ ==
file1.py
--
a = 20
from abc import *
print "Should this be printed when 'a' is alone imported from this
module"
file2.py
--
from file1 import a
print a
file2.py is used in a context where 'from abc import *' statement
doesn't make sense but it can make sense of (and requires) 'a'