class LengthMetaclass(type):

    def __len__(self):
        return self.clslength()


class A(object, metaclass=LengthMetaclass):
    pass

@classmethod
def clslength(cls):
    return 7
Is there a way to implement methods like __len__ or __eq__ as classmethods?