How to have application-wide global objects

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Thu Jul 13 13:35:50 EDT 2006


Fredrik Lundh wrote:

> "Sanjay" wrote:
> 
>> Trying hard, I am not even being able to figure out how to create an
>> object in one module and refer the same in another one. "import"
>> created a new object, as I tried.
> 
> "import" doesn't create new objects, so that's not very likely.  can you
> post some code so we don't have to guess what you've tried and not ?

It does if you mess around with sys.path between doing two imports of the
same thing (at least I found out the hard way on Python 2.4). I'm not sure
this is considered a bug or a "don't do that then" problem.

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list