Confused with classmethods

jfj jfj at freemail.gr
Fri Mar 11 17:04:26 EST 2005


Hi.

Suppose this:

########################

def foo (x):
     print x

f = classmethod (foo)

class A: pass

a=A()
a.f = f

a.f()
# TypeError: 'classmethod' object is not callable!

#######################

I understand that this is a very peculiar use of
classmethods but is this error intentional?
Or did I completely missed the point somewhere?

j.



More information about the Python-list mailing list