Python class decorator extending class causes recursion
I'm overwriting the save method of a ModelForm and I don't know why it would cause recursion: @parsleyfy class AccountForm(forms.ModelForm): def save(self, *args, **kwargs): # some other code... return super(AccountForm, self).save(*args,**kwargs) Causes this: maximum recursion depth exceeded while calling a Python object Stacktrace shows this line repetitively calling itself: return super(AccountForm, self).save(*args,**kwargs) Now, the parsley decorator is like this: def parsleyfy(klass): class ParsleyClass(klass): # some code here to add more stuff to the class return ParsleyClass As