[Tutor] Strange class behavior

Darrell Brogdon dbrogdon@valinux.com
Thu, 30 Nov 2000 11:37:07 -0500


Why is it that when I run the following script:

class myTestClass:
    def myTestMethod(self):
        print "Test, Test, 1-2-3"


b = myTestClass
b.myTestMethod()


I get the following error:

Traceback (most recent call last):
  File "./test2.py", line 9, in ?
    b.myTestMethod()
TypeError: unbound method must be called with class instance 1st
argument


Clearly I'm doing something wrong with the method definition but I've
not been able to determine what?