If you create a.py like
-test = 'Spam'
-
-class a:
-    def __init__(self, arg):
-        global test
-        test = arg
-        self.result = arg + ' added'

-    def __call__(self):
-        return self.result
and b.py like
-import a
-a.test = 'donkey'
-x = a.a('dinosaur')
-print a.test
It will print 'dinosaur', so you changed the global variable. The thing
is however that this is a highly confusing way of programming for me,
so I would not use it just because it is possible

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to