Dear fellow Pythonians, I just stumbled upon the following unexpected behavior:
class TestType(type): def Foo(self): return 'TestType Foo' class Test(object): __metaclass__ = TestType def Foo(self): return 'Test Foo' t = Test() print t.Foo() print Test.Foo() This will produce: Test Foo Traceback (most recent call last): File "test.py", line 8, in <module> print Test.Foo() TypeError: unbound method Foo() must be called with Test instance as first argument (got nothing instead) I can imagine why this is happening, and that there is no easy solution, but it is not what I was expecting. Anybody willing to explain the details of what's exactly going on during the method lookup of Test.Foo? Kind regards, Sebastian -- http://mail.python.org/mailman/listinfo/python-list