Best I could come up with was using an initialization function, but this does of course not run during parsing but shortly after:
test.py
my_objects = None
def update(foo):
globals()['my_objects'] = [foo, foo+1]
test2.py
_config = __import__("test")
_config.update(2)
print _config.my_objects
There are quite a lot of ideas floating around, but most of them involve messing with the imported module after import, not during parsing.
One way of making the variable available doing it is changing the calling module's (test2) __builtin__
before calling the import, but that seems like a pretty big hack to me. See the accepted answer in this discussion:
Python: How to make a cross-module variable?