I'm using Python 2.7.5, and I wasn't able to get the above solutions working for me. This is what I ended up with:
# define a class object (your class may be more complicated than this...)
class A(object):
pass
def func(self):
print 'I am class {}'.format(self.name)
A.func = func
# using classmethod() here failed with:
# AttributeError: type object '...' has no attribute 'name'