From 06d0151b256cac18a3c41d30f8cdb2883c28b086 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 22 Nov 2023 13:13:17 +0300 Subject: [PATCH] Enable `redundant-self` mypy error code (#11056) --- stdlib/zipfile.pyi | 2 +- tests/mypy_test.py | 2 ++ tests/typecheck_typeshed.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index 940b7230c..3313b9499 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -233,7 +233,7 @@ if sys.version_info >= (3, 8): def make(cls, source: ZipFile) -> CompleteDirs: ... @overload @classmethod - def make(cls: type[Self], source: StrPath | IO[bytes]) -> Self: ... + def make(cls, source: StrPath | IO[bytes]) -> Self: ... class Path: root: CompleteDirs diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 61b776afd..552dbd15c 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -268,6 +268,8 @@ def run_mypy( "--allow-subclassing-any", "--enable-error-code", "ignore-without-code", + "--enable-error-code", + "redundant-self", "--config-file", temp.name, ] diff --git a/tests/typecheck_typeshed.py b/tests/typecheck_typeshed.py index 83e31a1a0..4094399f0 100755 --- a/tests/typecheck_typeshed.py +++ b/tests/typecheck_typeshed.py @@ -63,6 +63,8 @@ def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> Retur "possibly-undefined", "--enable-error-code", "redundant-expr", + "--enable-error-code", + "redundant-self", "--custom-typeshed-dir", ".", ]