Skip to content

False positive for N805 in a child class #193

@skirpichev

Description

@skirpichev
$ cat -n a.py
     1  # pylint: disable=missing-class-docstring, missing-module-docstring
     2  
     3  class Foo(type):
     4      pass
     5  
     6  
     7  class Bar(Foo):
     8      def __init__(cls):
     9          super().__init__()
$ flake8 --ignore=D100,D101,D107 a.py 
a.py:8:19: N805 first argument of a method should be named 'self'

PEP8: Always use cls for the first argument to class methods.

Note that pylint is correct here:

$ pylint a.py

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions