1. Ian George
  2. pylint


Ian George  committed 139d972 Draft

Added the django classonlymethod decorator to checkers.typecheck to suppress E1120 warning for class-based views

  • Participants
  • Parent commits 79f6283
  • Branches default

Comments (0)

Files changed (1)

File pylint/checkers/typecheck.py

View file
         elif isinstance(called, astng.UnboundMethod):
             if called.decorators is not None:
                 for d in called.decorators.nodes:
-                    if isinstance(d, astng.Name) and (d.name == 'classmethod'):
+                    if isinstance(d, astng.Name) and (
+                            d.name in ['classmethod', 'classonlymethod']):
                         # Class methods have an extra implicit 'cls' argument.
                         num_positional_args += 1