Remove a bunch of unused imports (#3323)

This commit is contained in:
Sebastian Rittau
2019-10-08 16:59:32 +02:00
committed by Jelle Zijlstra
parent a6f146e651
commit 256b3ce8ab
47 changed files with 31 additions and 95 deletions

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar
_T = TypeVar('_T')

View File

@@ -1,6 +1,5 @@
# Stubs for _imp (Python 3.6)
import sys
import types
from typing import Any, List

View File

@@ -8,7 +8,6 @@
# _Loader is the PEP-451-defined interface for a loader type/object.
from abc import ABCMeta
import sys
from typing import Any, Dict, List, Optional, Protocol
class _Loader(Protocol):

View File

@@ -1,6 +1,5 @@
# Stubs for _operator (Python 3.5)
import sys
from typing import AnyStr
# In reality the import is the other way around, but this way we can keep the operator stub in 2and3

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Generator, List, TypeVar
from typing import Any, Callable, List, TypeVar
__all__: List[str]

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple
from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple
from .events import AbstractEventLoop
from concurrent.futures import (
CancelledError as CancelledError,

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Generator, Iterable, Iterator, List, Type, TypeVar, Union, Optional, Awaitable
from typing import Any, Callable, Generator, List, Type, TypeVar, Union, Optional, Awaitable
from .coroutines import coroutine
from .events import AbstractEventLoop

View File

@@ -1,7 +1,5 @@
import sys
from asyncio.events import AbstractEventLoop
from .coroutines import coroutine
from .futures import Future
from typing import Any, Generator, Generic, List, TypeVar, Optional
__all__: List[str]

View File

@@ -1,8 +1,8 @@
import concurrent.futures
import sys
from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable,
Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator,
Optional)
from typing import (
Any, TypeVar, Set, List, TextIO, Union, Tuple, Generic, Generator, Iterable, Awaitable, overload, Iterator, Optional,
)
from types import FrameType
from .events import AbstractEventLoop
from .futures import Future

View File

@@ -1,5 +1,5 @@
import sys
from typing import Dict, Any, TypeVar, Mapping, List, Optional, Tuple
from typing import Any, Mapping, List, Optional, Tuple
from asyncio.protocols import BaseProtocol
__all__: List[str]

View File

@@ -1,7 +1,6 @@
# Stubs for email (Python 3.4)
from typing import Callable, Optional, IO
import sys
from typing import Callable, IO
from email.message import Message
from email.policy import Policy

View File

@@ -1,7 +1,6 @@
# Stubs for email.feedparser (Python 3.4)
from typing import Callable
import sys
from email.message import Message
from email.policy import Policy

View File

@@ -3,7 +3,6 @@
from typing import (
List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any
)
import sys
from email.charset import Charset
from email.errors import MessageDefect
from email.header import Header

View File

@@ -3,7 +3,7 @@
import email.feedparser
from email.message import Message
from email.policy import Policy
from typing import BinaryIO, Callable, Optional, TextIO
from typing import BinaryIO, Callable, TextIO
FeedParser = email.feedparser.FeedParser
BytesFeedParser = email.feedparser.BytesFeedParser

View File

@@ -2,7 +2,6 @@
from abc import abstractmethod
from typing import Any, List, Optional, Tuple, Union, Callable
import sys
from email.message import Message
from email.errors import MessageDefect
from email.header import Header

View File

@@ -1,6 +1,3 @@
import codecs
import typing
def search_function(encoding: str) -> codecs.CodecInfo:
...
def search_function(encoding: str) -> codecs.CodecInfo: ...

View File

@@ -1,4 +1,3 @@
import sys
from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload
_AnyCallable = Callable[..., Any]

View File

@@ -2,7 +2,6 @@
# Based on http://docs.python.org/3.2/library/heapq.html
import sys
from typing import TypeVar, List, Iterable, Any, Callable, Optional
_T = TypeVar('_T')

View File

@@ -1,6 +1,5 @@
from typing import List, Optional, Tuple
from _markupbase import ParserBase
import sys
class HTMLParser(ParserBase):
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...

View File

@@ -1,6 +1,6 @@
# Stubs for http.cookies (Python 3.5)
from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union, Any
from typing import Generic, Dict, List, Mapping, Optional, TypeVar, Union, Any
_DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]]
_T = TypeVar('_T')

View File

@@ -1,5 +1,4 @@
from importlib.abc import Loader
import sys
import types
from typing import Any, Mapping, Optional, Sequence

View File

@@ -1,7 +1,6 @@
import importlib.abc
import sys
import types
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
from typing import Any, Callable, List, Optional, Sequence, Tuple
# ModuleSpec is exported from this module, but for circular import
# reasons exists in its own stub file (with Loader and ModuleType).

View File

@@ -4,7 +4,6 @@ from typing import (
import builtins
import codecs
from mmap import mmap
import sys
from types import TracebackType
from typing import TypeVar

View File

@@ -1,4 +1,3 @@
import sys
from typing import Any, Callable, Dict, List, Optional, Tuple
class JSONDecodeError(ValueError):

View File

@@ -2,7 +2,5 @@
# NOTE: These are incomplete!
from typing import overload, BinaryIO, TextIO
def get_osfhandle(file: int) -> int: ...
def open_osfhandle(handle: int, flags: int) -> int: ...

View File

@@ -1,9 +1,6 @@
# Stubs for multiprocessing
from typing import (
Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List,
Union, Sequence, Tuple, Type, overload
)
from typing import Any, Callable, Iterable, Mapping, Optional, List, Union, Sequence, Tuple, Type, overload
from ctypes import _CData
from logging import Logger

View File

@@ -5,10 +5,7 @@ import multiprocessing
from multiprocessing import synchronize
from multiprocessing import queues
import sys
from typing import (
Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type,
Union,
)
from typing import Any, Callable, Iterable, Optional, List, Mapping, Sequence, Type, Union
_LockLike = Union[synchronize.Lock, synchronize.RLock]

View File

@@ -1,13 +1,9 @@
from typing import Any, Optional, List, Type
from typing import Any, Optional, List
import array
import sys
import threading
import weakref
from .connection import Pipe
from threading import Lock, RLock, Semaphore, BoundedSemaphore
from threading import Event, Condition, Barrier
from queue import Queue
JoinableQueue = Queue

View File

@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Tuple, Type, TypeVar
from typing import Any, List, Optional, Tuple, TypeVar
from queue import Queue

View File

@@ -1,8 +1,4 @@
from typing import (
Any, Callable, ContextManager, Iterable, Mapping, Optional, List,
Type, TypeVar, Generic, Iterator
)
from types import TracebackType
from typing import Any, Callable, ContextManager, Iterable, Mapping, Optional, List, TypeVar, Generic, Iterator
_PT = TypeVar('_PT', bound=Pool)
_S = TypeVar('_S')

View File

@@ -5,7 +5,7 @@ from io import TextIOWrapper as _TextIOWrapper
from posix import listdir as listdir, times_result
import sys
from typing import (
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
Mapping, MutableMapping, Dict, List, Any, Tuple, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager
)

View File

@@ -4,10 +4,7 @@
import os
import sys
from typing import (
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
TypeVar, Union, Text, Callable, Optional
)
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
_T = TypeVar('_T')

View File

@@ -3,7 +3,7 @@
# NOTE: These are incomplete!
import sys
from typing import List, NamedTuple, Optional, overload, Tuple
from typing import List, NamedTuple, Optional, overload
from os import stat_result as stat_result

View File

@@ -2,10 +2,7 @@ from email.message import Message as _Message
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import (
Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union,
Pattern, Type, Callable, Protocol, overload)
import sys
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, Pattern, Type, Protocol, overload
_Reply = Tuple[int, bytes]
_SendErrs = Dict[str, _Reply]

View File

@@ -3,7 +3,6 @@
# Based on http://docs.python.org/3.2/library/stat.html
import sys
import typing
def S_ISDIR(mode: int) -> bool: ...
def S_ISCHR(mode: int) -> bool: ...

View File

@@ -2,7 +2,7 @@
# Based on http://docs.python.org/3.2/library/string.html
from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable
from typing import Mapping, Sequence, Any, Optional, Union, Tuple, Iterable
ascii_letters: str
ascii_lowercase: str

View File

@@ -2,11 +2,7 @@
# Based on http://docs.python.org/3.6/library/subprocess.html
import sys
from typing import (
Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text,
Generic, TypeVar, AnyStr,
overload,
)
from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload
from types import TracebackType
if sys.version_info >= (3, 8):

View File

@@ -1,4 +1,3 @@
import sys
import unittest.case
import unittest.suite
import unittest.result

View File

@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Tuple, Type
from typing import List, Optional, Tuple, Type
from types import TracebackType
import unittest.case

View File

@@ -1,5 +1,4 @@
from typing import Callable, Optional, TextIO, Tuple, Type, Union
import sys
import unittest.case
import unittest.result
import unittest.suite

View File

@@ -1,6 +1,5 @@
# Stubs for urllib.parse
from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional
import sys
_Str = Union[bytes, str]

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar
_T = TypeVar('_T')