Understanding "Too many ancestors" from pylint

The problem is that you inherit from a class which has itself (too) many ancestors: RegisterForm. In your case, you can't do a lot about this, beside stopping using it which is probably not an option. So you may want to disable this message for this class, eg:

class ExtendedRegisterForm(RegisterForm): # pylint: disable=too-many-ancestors

In addition to the disabling directives in the source code, you can configure this through the --max-parents= commandline option. You can also specify this in the config file (.pylintrc):

[DESIGN]
max-parents=15

As you can see I set it to 15 as many classes in Django (my project), particularly its view classes, will have hierarchies that are deeper than the default 7.

Tags:

Python

Pylint