Adding an object to another globals module in python

I know this is very evil, but is it possible to add an object to other global modules, for example:

#module dog.py
import cat
cat.globals.addVar('name','mittens')

and

#module cat.py
print name #mittens
+2
source share
1 answer
setattr(cat, 'name', 'mittens')

or

cat.name = 'mittens'
+2
source

All Articles