Skip to content

Commit b7926f2

Browse files
cehgvanrossum
authored andcommitted
Remove unused imports (#5694)
1 parent b37d08b commit b7926f2

File tree

7 files changed

+7
-16
lines changed

7 files changed

+7
-16
lines changed

mypy/checkexpr.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from contextlib import contextmanager
55
from typing import (
66
cast, Dict, Set, List, Tuple, Callable, Union, Optional, Iterable,
7-
Sequence, Any, Iterator
7+
Sequence, Iterator
88
)
99
MYPY = False
1010
if MYPY:
@@ -18,9 +18,8 @@
1818
from mypy.types import (
1919
Type, AnyType, CallableType, Overloaded, NoneTyp, TypeVarDef,
2020
TupleType, TypedDictType, Instance, TypeVarType, ErasedType, UnionType,
21-
PartialType, DeletedType, UnboundType, UninhabitedType, TypeType, TypeOfAny,
22-
true_only, false_only, is_named_instance, function_type, callable_type, FunctionLike,
23-
get_typ_args, StarType
21+
PartialType, DeletedType, UninhabitedType, TypeType, TypeOfAny, true_only,
22+
false_only, is_named_instance, function_type, callable_type, FunctionLike, StarType,
2423
)
2524
from mypy.nodes import (
2625
NameExpr, RefExpr, Var, FuncDef, OverloadedFuncDef, TypeInfo, CallExpr,
@@ -45,13 +44,12 @@
4544
from mypy.infer import infer_type_arguments, infer_function_type_arguments
4645
from mypy import join
4746
from mypy.meet import narrow_declared_type
48-
from mypy.maptype import map_instance_to_supertype
4947
from mypy.subtypes import (
5048
is_subtype, is_proper_subtype, is_equivalent, find_member, non_method_protocol_members,
5149
)
5250
from mypy import applytype
5351
from mypy import erasetype
54-
from mypy.checkmember import analyze_member_access, type_object_type, bind_self
52+
from mypy.checkmember import analyze_member_access, type_object_type
5553
from mypy.constraints import get_actual_type
5654
from mypy.checkstrformat import StringFormatterChecker
5755
from mypy.expandtype import expand_type, expand_type_by_instance, freshen_function_type_vars
@@ -61,8 +59,6 @@
6159
from mypy.plugin import Plugin, MethodContext, MethodSigContext, FunctionContext
6260
from mypy.typeanal import make_optional_type
6361

64-
from mypy import experiments
65-
6662
# Type of callback user for checking individual function arguments. See
6763
# check_args() below for details.
6864
ArgChecker = Callable[[Type, Type, int, Type, int, int, CallableType, Context, MessageBuilder],

mypy/errors.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
import sys
33
import traceback
44
from collections import OrderedDict, defaultdict
5-
from contextlib import contextmanager
65

7-
from typing import Tuple, List, TypeVar, Set, Dict, Iterator, Optional, cast
6+
from typing import Tuple, List, TypeVar, Set, Dict, Optional
87

98
from mypy.scope import Scope
109
from mypy.options import Options

mypy/fastparse2.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
different class hierarchies, which made it difficult to write a shared visitor between the
1515
two in a typesafe way.
1616
"""
17-
from functools import wraps
1817
import sys
1918

2019
from typing import Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List

mypy/main.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
import sys
1010
import time
1111

12-
from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
12+
from typing import Any, Dict, List, Mapping, Optional, Tuple
1313

1414
from mypy import build
1515
from mypy import defaults
1616
from mypy import experiments
1717
from mypy import util
18-
from mypy.build import BuildResult
1918
from mypy.modulefinder import BuildSource, FindModuleCache, mypy_path, SearchPaths
2019
from mypy.find_sources import create_source_list, InvalidSourceList
2120
from mypy.fscache import FileSystemCache

mypy/stats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Utilities for calculating and reporting statistics about types."""
22

3-
import os.path
3+
import os
44
import typing
55

66
from collections import Counter

mypy/util.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Utility functions with no non-trivial dependencies."""
22
import inspect
3-
import genericpath # type: ignore # no stub files yet
43
import os
54
import pathlib
65
import re

scripts/dumpmodule.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import sys
1313
import types
1414
from typing import Text
15-
from collections import defaultdict
1615

1716

1817
if sys.version_info >= (3, 0):

0 commit comments

Comments
 (0)