Creating classes and objects more than once?

Viktor Kerkez alefnula at gmail.com
Thu Nov 27 12:42:02 EST 2008


Here is the situation:

$ ls
test
$ cd test
$ ls
__init__.py data.py
$ cat __init__.py

$ cat data.py
DATA = {}

$ cd ..
$ python
>>> import os
>>> from test.data import DATA
>>> DATA['something'] = 33
>>> os.chdir('test')
>>> from data import DATA as NEW_DATA
>>> DATA
{'something': 33}
>>> NEW_DATA
{}


Is this a bug?




More information about the Python-list mailing list