pylint-errors

E0302 (unexpected-special-method-signature)

:x: Problematic code:

class Foo:
    def __enter__(self, context):
        pass

    def __exit__(self, type):
        pass

:heavy_check_mark: Correct code:

class Foo:
    def __enter__(self):
        pass

    def __exit__(self, type, value, traceback):
        pass

Rationale:

Emitted when a special method was defined with an invalid number of parameters. If it has too few or too many, it might not work at all.