A startup puzzle

Michael Hudson mwh at python.net
Mon Sep 29 14:40:47 EDT 2003


Stephen Horne <$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$.co.uk> writes:

> On Mon, 29 Sep 2003 11:31:05 -0500, "Edward K. Ream"
> <edreamleo at charter.net> wrote:
> 
> >Any ideas for a clean solution?  Thanks.
> 
> I am not sure that I understand what you are saying, but I'll make a
> quick suggestion...
> 
> Perhaps 'app' can be a global variable within 'leoGlobals', but
> assigned the value 'None' when the module is imported. Your
> initialisation code can then reassign the variable at the appropriate
> time.

This wont work.

--- a.py --- 
a = None
--- b.py ---
import a
a.a = 1
--- c.py ---
from a import a
import b
print a

running c.py will print "None".  Names, objects and bindings, remember
:-)

Cheers,
mwh

-- 
  Or if you happen to be resigned to the size of your trouser
  snake and would rather not be reminded of it, training a shared
  classifier to reject penis-enlargement spam stops Barry from
  getting the help he so desperately needs.  -- Tim Peters, c.l.python




More information about the Python-list mailing list