I created a python class for example like:
class A():
    def foo(self):
        #Does something
def bar(self):
    #Does some work
A.bar = bar
According to my understanding this should add bar to the class. But when do this in a different class I get the mentioned error
global a
a=A()
a.bar() # this gives the error
Thanks.
 
     
    