Skip to content

Remove unused imports #5694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from contextlib import contextmanager
from typing import (
cast, Dict, Set, List, Tuple, Callable, Union, Optional, Iterable,
Sequence, Any, Iterator
Sequence, Iterator
)
MYPY = False
if MYPY:
Expand All @@ -18,9 +18,8 @@
from mypy.types import (
Type, AnyType, CallableType, Overloaded, NoneTyp, TypeVarDef,
TupleType, TypedDictType, Instance, TypeVarType, ErasedType, UnionType,
PartialType, DeletedType, UnboundType, UninhabitedType, TypeType, TypeOfAny,
true_only, false_only, is_named_instance, function_type, callable_type, FunctionLike,
get_typ_args, StarType
PartialType, DeletedType, UninhabitedType, TypeType, TypeOfAny, true_only,
false_only, is_named_instance, function_type, callable_type, FunctionLike, StarType,
)
from mypy.nodes import (
NameExpr, RefExpr, Var, FuncDef, OverloadedFuncDef, TypeInfo, CallExpr,
Expand All @@ -45,13 +44,12 @@
from mypy.infer import infer_type_arguments, infer_function_type_arguments
from mypy import join
from mypy.meet import narrow_declared_type
from mypy.maptype import map_instance_to_supertype
from mypy.subtypes import (
is_subtype, is_proper_subtype, is_equivalent, find_member, non_method_protocol_members,
)
from mypy import applytype
from mypy import erasetype
from mypy.checkmember import analyze_member_access, type_object_type, bind_self
from mypy.checkmember import analyze_member_access, type_object_type
from mypy.constraints import get_actual_type
from mypy.checkstrformat import StringFormatterChecker
from mypy.expandtype import expand_type, expand_type_by_instance, freshen_function_type_vars
Expand All @@ -61,8 +59,6 @@
from mypy.plugin import Plugin, MethodContext, MethodSigContext, FunctionContext
from mypy.typeanal import make_optional_type

from mypy import experiments

# Type of callback user for checking individual function arguments. See
# check_args() below for details.
ArgChecker = Callable[[Type, Type, int, Type, int, int, CallableType, Context, MessageBuilder],
Expand Down
3 changes: 1 addition & 2 deletions mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import sys
import traceback
from collections import OrderedDict, defaultdict
from contextlib import contextmanager

from typing import Tuple, List, TypeVar, Set, Dict, Iterator, Optional, cast
from typing import Tuple, List, TypeVar, Set, Dict, Optional

from mypy.scope import Scope
from mypy.options import Options
Expand Down
1 change: 0 additions & 1 deletion mypy/fastparse2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
different class hierarchies, which made it difficult to write a shared visitor between the
two in a typesafe way.
"""
from functools import wraps
import sys

from typing import Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List
Expand Down
3 changes: 1 addition & 2 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
import sys
import time

from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
from typing import Any, Dict, List, Mapping, Optional, Tuple

from mypy import build
from mypy import defaults
from mypy import experiments
from mypy import util
from mypy.build import BuildResult
from mypy.modulefinder import BuildSource, FindModuleCache, mypy_path, SearchPaths
from mypy.find_sources import create_source_list, InvalidSourceList
from mypy.fscache import FileSystemCache
Expand Down
2 changes: 1 addition & 1 deletion mypy/stats.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Utilities for calculating and reporting statistics about types."""

import os.path
import os
import typing

from collections import Counter
Expand Down
1 change: 0 additions & 1 deletion mypy/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Utility functions with no non-trivial dependencies."""
import inspect
import genericpath # type: ignore # no stub files yet
import os
import pathlib
import re
Expand Down
1 change: 0 additions & 1 deletion scripts/dumpmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import sys
import types
from typing import Text
from collections import defaultdict


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