return-in-init / E0101#

Message emitted:

Explicit return in __init__

Description:

Used when the special class method __init__ has an explicit return value.

Correct code:

class Sum:

    def __init__(self, a, b) -> None:
        self.result = a + b

Problematic code:

class Sum:

    def __init__(self, a, b):  # [return-in-init]
        return a + b

Related links:

Created by the basic checker.