pylint-errors

W0201 (attribute-defined-outside-init)

:x: Problematic code:

class Foo:
    def bar(self):
        self.baz = True

:heavy_check_mark: Correct code:

class Foo:
    def __init__(self):
        self.baz = None

    def bar(self, value):
        self.baz = value

Rationale:

Used when an instance attribute is defined outside the __init__ method.