Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32263c2

Browse files
authored
Remove a bunch of unused imports (#6041)
1 parent dac0135 commit 32263c2

31 files changed

Lines changed: 42 additions & 63 deletions

misc/analyze_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from typing import Any, Dict, Generator, Iterable, List, Optional
3+
from typing import Any, Dict, Iterable, List, Optional
44
from collections import Counter
55

66
import os

misc/async_matrix.py

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

88
import sys
99
from types import coroutine
10-
from typing import Any, AsyncIterator, Awaitable, Generator, Iterator
10+
from typing import Any, Awaitable, Generator, Iterator
1111

1212
# The various things you might try to use in `await` or `yield from`.
1313

misc/incremental_checker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333

3434
from typing import Any, Dict, List, Optional, Tuple
3535

36-
from argparse import (ArgumentParser, RawDescriptionHelpFormatter,
37-
ArgumentDefaultsHelpFormatter, Namespace)
36+
from argparse import ArgumentParser, RawDescriptionHelpFormatter, Namespace
3837
import base64
3938
import json
4039
import os

mypy/build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
from mypy.version import __version__
5151
from mypy.plugin import Plugin, ChainedPlugin, plugin_types
5252
from mypy.plugins.default import DefaultPlugin
53-
from mypy.defaults import PYTHON3_VERSION_MIN
5453
from mypy.server.deps import get_dependencies
5554
from mypy.fscache import FileSystemCache
5655
from mypy.typestate import TypeState, reset_global_state

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
true_only, false_only, function_type, is_named_instance, union_items, TypeQuery, LiteralType,
3535
is_optional, remove_optional
3636
)
37-
from mypy.sametypes import is_same_type, is_same_types
37+
from mypy.sametypes import is_same_type
3838
from mypy.messages import MessageBuilder, make_inferred_type_note
3939
import mypy.checkexpr
4040
from mypy.checkmember import (

mypy/constraints.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
UninhabitedType, TypeType, TypeVarId, TypeQuery, is_named_instance, TypeOfAny, LiteralType,
99
)
1010
from mypy.maptype import map_instance_to_supertype
11-
from mypy import nodes
1211
import mypy.subtypes
1312
from mypy.sametypes import is_same_type
1413
from mypy.erasetype import erase_typevars

mypy/dmypy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import json
1212
import os
1313
import pickle
14-
import signal
15-
import subprocess
1614
import sys
1715
import time
1816
import traceback

mypy/dmypy_server.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
to enable fine-grained incremental reprocessing of changes.
77
"""
88

9-
import argparse
109
import base64
1110
import json
1211
import os
1312
import pickle
14-
import random
1513
import subprocess
1614
import sys
17-
import tempfile
1815
import time
1916
import traceback
2017

@@ -26,7 +23,7 @@
2623
from mypy.find_sources import create_source_list, InvalidSourceList
2724
from mypy.server.update import FineGrainedBuildManager
2825
from mypy.dmypy_util import receive
29-
from mypy.ipc import IPCServer, IPCException
26+
from mypy.ipc import IPCServer
3027
from mypy.fscache import FileSystemCache
3128
from mypy.fswatcher import FileSystemWatcher, FileData
3229
from mypy.modulefinder import BuildSource, compute_search_paths

mypy/errors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
from mypy.options import Options
1010
from mypy.version import __version__ as mypy_version
1111

12+
MYPY = False
13+
if MYPY:
14+
from typing_extensions import Final
1215

1316
T = TypeVar('T')
14-
allowed_duplicates = ['@overload', 'Got:', 'Expected:']
17+
allowed_duplicates = ['@overload', 'Got:', 'Expected:'] # type: Final
1518

1619

1720
class ErrorInfo:

mypy/exprtotype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mypy.fastparse import parse_type_comment
99
from mypy.types import (
1010
Type, UnboundType, TypeList, EllipsisType, AnyType, Optional, CallableArgument, TypeOfAny,
11-
LiteralType, RawLiteralType,
11+
RawLiteralType,
1212
)
1313

1414

0 commit comments

Comments
 (0)