From e79d982feae5d86bccb0b69d806da2993f88bba4 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 1 Oct 2021 20:15:39 +0300 Subject: [PATCH 1/2] Removes unused imports in mypy --- mypy/expandtype.py | 2 +- mypy/fastparse.py | 2 +- mypy/server/astmerge.py | 2 +- mypy/test/test_find_sources.py | 1 - mypy/test/typefixture.py | 2 +- mypy/typeanal.py | 5 ++--- mypy/types.py | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/mypy/expandtype.py b/mypy/expandtype.py index 8b7d434d1e31..43fe7944ec70 100644 --- a/mypy/expandtype.py +++ b/mypy/expandtype.py @@ -2,7 +2,7 @@ from mypy.types import ( Type, Instance, CallableType, TypeVisitor, UnboundType, AnyType, - NoneType, TypeVarType, Overloaded, TupleType, TypedDictType, UnionType, + NoneType, Overloaded, TupleType, TypedDictType, UnionType, ErasedType, PartialType, DeletedType, UninhabitedType, TypeType, TypeVarId, FunctionLike, TypeVarType, LiteralType, get_proper_type, ProperType, TypeAliasType, ParamSpecType diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 2f4122bf3bfa..34b1b801bc31 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -5,7 +5,7 @@ import typing # for typing.Type, which conflicts with types.Type from typing import ( - Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List, overload + Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List ) from typing_extensions import Final, Literal, overload diff --git a/mypy/server/astmerge.py b/mypy/server/astmerge.py index 5d6a810264b6..11ce494fba0e 100644 --- a/mypy/server/astmerge.py +++ b/mypy/server/astmerge.py @@ -57,7 +57,7 @@ from mypy.traverser import TraverserVisitor from mypy.types import ( Type, SyntheticTypeVisitor, Instance, AnyType, NoneType, CallableType, ErasedType, DeletedType, - TupleType, TypeType, TypeVarType, TypedDictType, UnboundType, UninhabitedType, UnionType, + TupleType, TypeType, TypedDictType, UnboundType, UninhabitedType, UnionType, Overloaded, TypeVarType, TypeList, CallableArgument, EllipsisType, StarType, LiteralType, RawExpressionType, PartialType, PlaceholderType, TypeAliasType ) diff --git a/mypy/test/test_find_sources.py b/mypy/test/test_find_sources.py index ba5b613a0948..7824c82208f9 100644 --- a/mypy/test/test_find_sources.py +++ b/mypy/test/test_find_sources.py @@ -7,7 +7,6 @@ from mypy.find_sources import InvalidSourceList, SourceFinder, create_source_list from mypy.fscache import FileSystemCache -from mypy.modulefinder import BuildSource from mypy.options import Options from mypy.modulefinder import BuildSource diff --git a/mypy/test/typefixture.py b/mypy/test/typefixture.py index 4e929225fc3f..3b12caebae4b 100644 --- a/mypy/test/typefixture.py +++ b/mypy/test/typefixture.py @@ -7,7 +7,7 @@ from mypy.semanal_shared import set_callable_name from mypy.types import ( - Type, TypeVarType, AnyType, NoneType, Instance, CallableType, TypeVarType, TypeType, + Type, AnyType, NoneType, Instance, CallableType, TypeVarType, TypeType, UninhabitedType, TypeOfAny, TypeAliasType, UnionType, LiteralType ) from mypy.nodes import ( diff --git a/mypy/typeanal.py b/mypy/typeanal.py index 6e2cb350f6e6..85abe86b6f8b 100644 --- a/mypy/typeanal.py +++ b/mypy/typeanal.py @@ -12,10 +12,9 @@ from mypy.messages import MessageBuilder, quote_type_string, format_type_bare from mypy.options import Options from mypy.types import ( - Type, UnboundType, TypeVarType, TupleType, TypedDictType, UnionType, Instance, AnyType, + Type, UnboundType, TupleType, TypedDictType, UnionType, Instance, AnyType, CallableType, NoneType, ErasedType, DeletedType, TypeList, TypeVarType, SyntheticTypeVisitor, - StarType, PartialType, EllipsisType, UninhabitedType, TypeType, TypeVarLikeType, - CallableArgument, TypeQuery, union_items, TypeOfAny, LiteralType, RawExpressionType, + StarType, PartialType, EllipsisType, UninhabitedType, TypeType, CallableArgument, TypeQuery, union_items, TypeOfAny, LiteralType, RawExpressionType, PlaceholderType, Overloaded, get_proper_type, TypeAliasType, TypeVarLikeType, ParamSpecType ) diff --git a/mypy/types.py b/mypy/types.py index 43078ef96e61..75eb5a045773 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -7,7 +7,7 @@ from typing import ( Any, TypeVar, Dict, List, Tuple, cast, Set, Optional, Union, Iterable, NamedTuple, - Sequence, Iterator, overload + Sequence, Iterator ) from typing_extensions import ClassVar, Final, TYPE_CHECKING, overload From a8bfa1b974176a900c1572bbfac7c296c6b0be75 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 1 Oct 2021 20:22:33 +0300 Subject: [PATCH 2/2] Fixes flake8 --- mypy/typeanal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mypy/typeanal.py b/mypy/typeanal.py index 85abe86b6f8b..0aa90d49cfb5 100644 --- a/mypy/typeanal.py +++ b/mypy/typeanal.py @@ -14,8 +14,10 @@ from mypy.types import ( Type, UnboundType, TupleType, TypedDictType, UnionType, Instance, AnyType, CallableType, NoneType, ErasedType, DeletedType, TypeList, TypeVarType, SyntheticTypeVisitor, - StarType, PartialType, EllipsisType, UninhabitedType, TypeType, CallableArgument, TypeQuery, union_items, TypeOfAny, LiteralType, RawExpressionType, - PlaceholderType, Overloaded, get_proper_type, TypeAliasType, TypeVarLikeType, ParamSpecType + StarType, PartialType, EllipsisType, UninhabitedType, TypeType, CallableArgument, + TypeQuery, union_items, TypeOfAny, LiteralType, RawExpressionType, + PlaceholderType, Overloaded, get_proper_type, TypeAliasType, + TypeVarLikeType, ParamSpecType ) from mypy.nodes import (