def arity(self, method):
    return getattr(self.__class__, method).__code__.co_argcount - 1
functor = arity.__class__
functor.arity = arity
arity.__class__.arity = arity
Как узнать арность метода в Python