Skip unused argument checks for magic methods (#1801)

We still check `__init__`, `__call__`, and `__new__`.

Closes #1796.
This commit is contained in:
Charlie Marsh
2023-01-11 19:02:20 -05:00
committed by GitHub
parent c56f263618
commit 9d48d7bbd1
7 changed files with 77 additions and 28 deletions

View File

@@ -181,3 +181,17 @@ def f(a: int, b: int) -> str:
def f(a, b):
return f"{a}{b}"
###
# Unused arguments on magic methods.
###
class C:
def __init__(self, x) -> None:
print("Hello, world!")
def __str__(self) -> str:
return "Hello, world!"
def __exit__(self, exc_type, exc_value, traceback) -> None:
print("Hello, world!")