Skip to content

Commit 073ff36

Browse files
committed
Remove unused imports using autoflake and pycln
1 parent 9af766b commit 073ff36

File tree

193 files changed

+114
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+114
-260
lines changed

misc/actions_stubs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import shutil
7-
from typing import Any, Tuple
7+
from typing import Any
88

99
try:
1010
import click

misc/analyze_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77
import os.path
88
from collections import Counter
9-
from typing import Any, Dict, Iterable, List, Optional
9+
from typing import Any, Dict, Iterable
1010

1111
ROOT = ".mypy_cache/3.5"
1212

misc/diff-cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313
import sys
1414
from collections import defaultdict
15-
from typing import Any, Dict, Optional, Set
15+
from typing import Any
1616

1717
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
1818

misc/dump-ast.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import argparse
99
import sys
10-
from typing import Tuple
1110

1211
from mypy import defaults
1312
from mypy.errors import CompileError

misc/incremental_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import textwrap
4545
import time
4646
from argparse import ArgumentParser, Namespace, RawDescriptionHelpFormatter
47-
from typing import Any, Dict, List, Optional, Tuple
47+
from typing import Any, Dict, Tuple
4848

4949
CACHE_PATH = ".incremental_checker_cache.json"
5050
MYPY_REPO_URL = "https://github.com/python/mypy.git"

misc/perf_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import subprocess
99
import textwrap
1010
import time
11-
from typing import Callable, List, Tuple
11+
from typing import Callable, Tuple
1212

1313

1414
class Command:

misc/proper_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Callable, Optional, Type as typing_Type
3+
from typing import Callable, Type as typing_Type
44

55
from mypy.nodes import TypeInfo
66
from mypy.plugin import FunctionContext, Plugin

misc/sync-typeshed.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import sys
1717
import tempfile
1818
import textwrap
19-
from typing import Optional
2019

2120

2221
def check_state() -> None:

misc/touch_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111
import textwrap
1212
import time
13-
from typing import Callable, List, Optional, Tuple
13+
from typing import Callable, Optional, Tuple
1414

1515

1616
def print_offset(text: str, indent_length: int = 4) -> None:

misc/upload-pypi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import venv
1919
from concurrent.futures import ThreadPoolExecutor
2020
from pathlib import Path
21-
from typing import Any, Dict, Iterator, List
21+
from typing import Any, Iterator
2222
from urllib.request import urlopen
2323

2424
BASE = "https://api.github.com/repos"

mypy/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
import sys
4949
from io import StringIO
50-
from typing import Callable, List, TextIO, Tuple
50+
from typing import Callable, TextIO
5151

5252

5353
def _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> tuple[str, str, int]:

mypy/applytype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Callable, Dict, Optional, Sequence
3+
from typing import Callable, Sequence
44

55
import mypy.subtypes
66
from mypy.expandtype import expand_type

mypy/argmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Callable, List, Optional, Sequence, Set
5+
from typing import Callable, Sequence, TYPE_CHECKING
66

77
from mypy import nodes
88
from mypy.maptype import map_instance_to_supertype

mypy/binder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections import defaultdict
44
from contextlib import contextmanager
5-
from typing import DefaultDict, Dict, Iterator, List, Optional, Set, Tuple, Union, cast
5+
from typing import DefaultDict, Iterator, List, Optional, Tuple, Union, cast
66
from typing_extensions import TypeAlias as _TypeAlias
77

88
from mypy.erasetype import remove_instance_last_known_values

mypy/build.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,13 @@
3232
Dict,
3333
Iterable,
3434
Iterator,
35-
List,
3635
Mapping,
3736
NamedTuple,
3837
NoReturn,
3938
Optional,
4039
Sequence,
41-
Set,
4240
TextIO,
43-
Tuple,
4441
TypeVar,
45-
Union,
4642
)
4743
from typing_extensions import Final, TypeAlias as _TypeAlias
4844

mypy/checker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
Generic,
1515
Iterable,
1616
Iterator,
17-
List,
1817
Mapping,
1918
NamedTuple,
2019
Optional,
2120
Sequence,
22-
Set,
2321
Tuple,
2422
TypeVar,
2523
Union,

mypy/checkexpr.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
from typing import (
88
Callable,
99
ClassVar,
10-
Dict,
1110
Iterator,
1211
List,
1312
Optional,
1413
Sequence,
15-
Set,
16-
Tuple,
17-
Union,
1814
cast,
1915
)
2016
from typing_extensions import Final, TypeAlias as _TypeAlias, overload

mypy/checkmember.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Callable, Optional, Sequence, Union, cast
5+
from typing import Callable, Sequence, TYPE_CHECKING, cast
66

77
from mypy import meet, message_registry, subtypes
88
from mypy.erasetype import erase_typevars

mypy/checkpattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from collections import defaultdict
6-
from typing import Dict, List, NamedTuple, Optional, Set, Tuple, Union
6+
from typing import NamedTuple
77
from typing_extensions import Final
88

99
import mypy.checker

mypy/checkstrformat.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
TYPE_CHECKING,
1818
Callable,
1919
Dict,
20-
List,
2120
Match,
22-
Optional,
2321
Pattern,
24-
Set,
2522
Tuple,
2623
Union,
2724
cast,

mypy/config_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
List,
2222
Mapping,
2323
MutableMapping,
24-
Optional,
2524
Sequence,
2625
TextIO,
2726
Tuple,

mypy/constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Iterable, List, Optional, Sequence
5+
from typing import Iterable, List, Sequence, TYPE_CHECKING
66
from typing_extensions import Final
77

88
import mypy.subtypes

mypy/dmypy/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import sys
1515
import time
1616
import traceback
17-
from typing import Any, Callable, Dict, List, Mapping, NoReturn, Optional, Tuple
17+
from typing import Any, Callable, Mapping, NoReturn
1818

1919
from mypy.dmypy_os import alive, kill
2020
from mypy.dmypy_util import DEFAULT_STATUS_FILE, receive
@@ -262,7 +262,6 @@ class BadStatus(Exception):
262262
- Process whose pid is in the status file does not exist
263263
"""
264264

265-
pass
266265

267266

268267
def main(argv: list[str]) -> None:

mypy/dmypy_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import time
1818
import traceback
1919
from contextlib import redirect_stderr, redirect_stdout
20-
from typing import AbstractSet, Any, Callable, Dict, List, Optional, Sequence, Set, Tuple
20+
from typing import AbstractSet, Any, Callable, List, Sequence, Tuple
2121
from typing_extensions import Final
2222

2323
import mypy.build

mypy/erasetype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Callable, Container, Dict, List, Optional, cast
3+
from typing import Callable, Container, cast
44

55
from mypy.nodes import ARG_STAR, ARG_STAR2
66
from mypy.types import (

mypy/errorcodes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from __future__ import annotations
77

8-
from typing import Dict
98
from typing_extensions import Final
109

1110
error_codes: dict[str, ErrorCode] = {}

mypy/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import traceback
66
from collections import defaultdict
7-
from typing import Callable, Dict, List, NoReturn, Optional, Set, TextIO, Tuple, TypeVar, Union
7+
from typing import Callable, NoReturn, Optional, TextIO, Tuple, TypeVar
88
from typing_extensions import Final, Literal
99

1010
from mypy import errorcodes as codes

mypy/expandtype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Dict, Iterable, List, Mapping, Optional, Sequence, TypeVar, Union, cast
3+
from typing import Iterable, Mapping, Sequence, TypeVar, cast
44

55
from mypy.types import (
66
AnyType,

mypy/exprtotype.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
65

76
from mypy.fastparse import parse_type_string
87
from mypy.nodes import (

mypy/fastparse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import copy
44
import re
55
import sys
6-
import typing # for typing.Type, which conflicts with types.Type
76
import warnings
8-
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, cast
7+
from typing import Any, Callable, List, Optional, Sequence, TypeVar, Union, cast
98
from typing_extensions import Final, Literal, overload
109

1110
from mypy import defaults, errorcodes as codes, message_registry

mypy/find_sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import functools
66
import os
7-
from typing import List, Optional, Sequence, Set, Tuple
7+
from typing import Sequence
88
from typing_extensions import Final
99

1010
from mypy.fscache import FileSystemCache

mypy/fixup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, Dict, Optional
5+
from typing import Any
66
from typing_extensions import Final
77

88
from mypy.lookup import lookup_fully_qualified

mypy/fscache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import os
3434
import stat
35-
from typing import Dict, List, Set
3635

3736
from mypy_extensions import mypyc_attr
3837

mypy/fswatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import AbstractSet, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple
5+
from typing import AbstractSet, Iterable, NamedTuple
66

77
from mypy.fscache import FileSystemCache
88

mypy/gclogger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import gc
44
import time
5-
from typing import Mapping, Optional
5+
from typing import Mapping
66

77

88
class GcLogger:

mypy/indirection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Dict, Iterable, List, Optional, Set, Union
3+
from typing import Iterable, Set
44

55
import mypy.types as types
66
from mypy.types import TypeVisitor

mypy/infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, NamedTuple, Optional, Sequence
5+
from typing import NamedTuple, Sequence
66

77
from mypy.constraints import (
88
SUBTYPE_OF,

mypy/inspections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from collections import defaultdict
55
from functools import cmp_to_key
6-
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
6+
from typing import Callable
77

88
from mypy.build import State
99
from mypy.find_sources import InvalidSourceList, SourceFinder

mypy/ipc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import sys
1313
import tempfile
1414
from types import TracebackType
15-
from typing import Callable, Optional, Type
15+
from typing import Callable
1616
from typing_extensions import Final
1717

1818
if sys.platform == "win32":
@@ -35,7 +35,6 @@
3535
class IPCException(Exception):
3636
"""Exception for IPC issues."""
3737

38-
pass
3938

4039

4140
class IPCBase:

mypy/join.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional, Tuple
65

76
import mypy.typeops
87
from mypy.maptype import map_instance_to_supertype

mypy/literals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, Iterable, Optional, Tuple, Union
3+
from typing import Any, Iterable, Optional, Tuple
44
from typing_extensions import Final
55

66
from mypy.nodes import (

0 commit comments

Comments
 (0)