Johannes Schneider writes:
> I remember some document explaining the python imports in detail
> somewhere, but I don't have any idea where it was. Even no idea if it
> was in the List or some blogbost.
What kind of detail do you want?
> Does anybody of you have some suggestions where I can find
iplyXbyA(32)
>
> > Keeps your vars in a safer easier to handle, debug, and change kinda way
> > Good luck
>
> > AJ
>
> > -Original Message-
> > From: python-list-bounces+aj=xernova@python.org
> > [mailto:python-list-bounces+aj=xernova@pytho
@python.org] On Behalf Of David
Stanek
Sent: Monday, April 13, 2009 12:12 PM
To: Ravi
Cc: python-list@python.org
Subject: Re: Imports in python are static, any solution?
On Mon, Apr 13, 2009 at 11:59 AM, Ravi wrote:
foo.py :
i = 10
def fi():
global i
i = 99
bar.py :
import
Behalf Of David
Stanek
Sent: Monday, April 13, 2009 12:12 PM
To: Ravi
Cc: python-list@python.org
Subject: Re: Imports in python are static, any solution?
On Mon, Apr 13, 2009 at 11:59 AM, Ravi wrote:
> foo.py :
>
> i = 10
>
> def fi():
> global i
> i = 99
>
>
On Mon, Apr 13, 2009 at 11:59 AM, Ravi wrote:
> foo.py :
>
> i = 10
>
> def fi():
> global i
> i = 99
>
> bar.py :
>
> import foo
> from foo import i
>
> print i, foo.i
> foo.fi()
> print i, foo.i
>
> This is problematic. Well I want i to change with foo.fi() .
Why n
Quoting Ravi :
>
> This is problematic. Well I want i to change with foo.fi() .
You can't. i and foo.i are _different_ variables that just happen to share the
same value initially. What you are observing is no different than
i = 10
j = i
i = 99
print i # prints 99
print j # print 10
May I