> class MyClass: > "A simple example class" > i = 12345 > def f(self): > return 'hello world' > > > From here I run: > x = MyClass
Did you mean x = MyClass() > xf = x.f > while True: > print xf() > > This gives the following error: > > Traceback (most recent call last): > File "<stdin>", line 2, in ? > TypeError: unbound method f() must be called with MyClass instance as > first argument (got nothing instead) > > Please help...this is killing me! What you are really calling is MyClass.f without any arguments. -- damjan -- http://mail.python.org/mailman/listinfo/python-list