The __exit__
method is invoked with four arguments: self, type, value and traceback. Leave one of these out of the method declaration
and the result will be a TypeError
at runtime.
Noncompliant Code Example
class MyClass:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val): # Noncompliant
pass
Deprecated
This rule is deprecated; use {rule:python:S5722} instead.