Re: imported var not being updated
- From: John Posner <jjposner@xxxxxxxxxxx>
- Date: Tue, 09 Mar 2010 09:18:42 -0500
On 3/8/2010 11:55 PM, Gary Herron wrote:
<snip>
The form of import you are using
from helpers import mostRecent
makes a *new* binding to the value in the module that's doing the
import.
<snip>
What you can do, is not make a separate binding, but reach into the
helpers module to get the value there. Like this:
import helpers
print helpers.mostRecent
Gary, are you asserting that in these separate situations:
one.py:
from helpers import mostRecent
x = mostRecent
two.py:
import helpers
x = helpers.mostRecent
.... the name "x" will be bound to different objects?
Tx,
John
.
- Follow-Ups:
- Re: imported var not being updated
- From: Bruno Desthuilliers
- Re: imported var not being updated
- References:
- Re: imported var not being updated
- From: Gary Herron
- Re: imported var not being updated
- Prev by Date: Re: a newbie's question
- Next by Date: Re: (updated) Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime
- Previous by thread: Re: imported var not being updated
- Next by thread: Re: imported var not being updated
- Index(es):
Relevant Pages
|