pylint-errors

E0203 (access-member-before-definition)

:x: Problematic code:

class Foo:
    def __init__(self, bar):
        if self.bar:
            pass

:heavy_check_mark: Correct code:

class Foo:
    def __init__(self, bar):
        self.bar = bar
        if self.bar:
            pass

Rationale:

Used when an instance member is accessed before it’s actually assigned.