Removed imported symbols that are not accessed or re-exported (#4387)

Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
Eric Traut
2020-08-05 22:49:17 -07:00
committed by GitHub
parent e17c6a752e
commit 04c74640f0
53 changed files with 52 additions and 97 deletions

View File

@@ -1,9 +1,8 @@
import sys
from types import TracebackType
from typing import Any, Awaitable, Callable, Generator, Iterable, Optional, Type, TypeVar, Union
from typing import Any, Awaitable, Callable, Generator, Optional, Type, TypeVar, Union
from .events import AbstractEventLoop
from .futures import Future
_T = TypeVar("_T")

View File

@@ -1,6 +1,6 @@
import sys
from asyncio import transports
from typing import Optional, Tuple, Union
from typing import Optional, Tuple
class BaseProtocol:
def connection_made(self, transport: transports.BaseTransport) -> None: ...

View File

@@ -1,4 +1,3 @@
# These are not exported.
import sys
import typing
from typing import (
@@ -37,9 +36,6 @@ from typing import (
overload,
)
# These are exported.
from . import abc
if sys.version_info >= (3, 6):
from typing import AsyncGenerator as AsyncGenerator, Collection as Collection

View File

@@ -1,4 +1,3 @@
import sys
from types import TracebackType
from typing import Iterator, MutableMapping, Optional, Type, Union
from typing_extensions import Literal

View File

@@ -1,12 +1,6 @@
import sys
from types import TracebackType
from typing import Iterator, MutableMapping, Optional, Type, Union
if sys.version_info >= (3, 8):
from typing import Final
else:
from typing_extensions import Final
_KeyType = Union[str, bytes]
_ValueType = Union[str, bytes]

View File

@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Generic, Iterator, List, Optional, Type, TypeVar, Union, overload
from typing import List, Optional, Type, TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]

View File

@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Generic, Iterator, List, Optional, Type, TypeVar, Union, overload
from typing import List, Optional, Type, TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]

View File

@@ -3,7 +3,6 @@
from email.charset import Charset
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.header import Header
from email.policy import Policy
from typing import Any, Generator, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import StrPath
from typing import IO, Any, Container, Iterable, Optional, Sequence, Type, TypeVar, Union, overload
from typing import IO, Any, Container, Iterable, Optional, Sequence, Type, TypeVar, overload
from typing_extensions import Literal
class NullTranslations:

View File

@@ -2,7 +2,7 @@
import sys
from _typeshed import ReadableBuffer
from typing import AbstractSet, Optional, Union
from typing import AbstractSet, Optional
class _Hash(object):
digest_size: int

View File

@@ -3,7 +3,7 @@
import email.message
import socketserver
import sys
from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union
from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union
if sys.version_info >= (3, 7):
from builtins import _PathLike

View File

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

View File

@@ -2,7 +2,6 @@ import builtins
import codecs
import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from mmap import mmap
from types import TracebackType
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, TypeVar, Union

View File

@@ -1,7 +1,6 @@
import sys
from ctypes import _CData
from logging import Logger
from multiprocessing import connection, pool, sharedctypes, spawn, synchronize
from multiprocessing import connection, pool, sharedctypes, synchronize
from multiprocessing.context import (
AuthenticationError as AuthenticationError,
BaseContext,
@@ -18,7 +17,7 @@ from multiprocessing.process import active_children as active_children, current_
# These are technically functions that return instances of these Queue classes. See #4313 for discussion
from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue
from multiprocessing.spawn import freeze_support as freeze_support
from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Type, Union, overload
from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Union, overload
from typing_extensions import Literal
if sys.version_info >= (3, 8):

View File

@@ -1,7 +1,7 @@
import sys
import tkinter
from tkinter import Event
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, List, Optional, overload
from typing_extensions import Literal
def tclobjs_to_py(adict): ...

View File

@@ -2,7 +2,6 @@ import datetime
import logging
import sys
import unittest.result
import warnings
from types import TracebackType
from typing import (
Any,
@@ -27,6 +26,7 @@ from typing import (
Union,
overload,
)
from warnings import WarningMessage
_E = TypeVar("_E", bound=BaseException)
_FT = TypeVar("_FT", bound=Callable[..., Any])
@@ -260,10 +260,10 @@ class _AssertRaisesContext(Generic[_E]):
) -> bool: ...
class _AssertWarnsContext:
warning: warnings.WarningMessage
warning: WarningMessage
filename: str
lineno: int
warnings: List[warnings.WarningMessage]
warnings: List[WarningMessage]
def __enter__(self) -> _AssertWarnsContext: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]

View File

@@ -1,4 +1,4 @@
from typing import Dict, Union
from typing import Union
from urllib.response import addinfourl
# Stubs for urllib.error

View File

@@ -2,7 +2,7 @@
from email.message import Message
from types import TracebackType
from typing import IO, Any, BinaryIO, Callable, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar
from typing import IO, Any, BinaryIO, Callable, Iterable, List, Optional, Tuple, Type, TypeVar
_AIUT = TypeVar("_AIUT", bound=addbase)

View File

@@ -1,10 +1,10 @@
import gzip
import http.client
import io
import sys
import time
from _typeshed import SupportsRead, SupportsWrite
from datetime import datetime
from io import BytesIO
from types import TracebackType
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Protocol, Tuple, Type, Union, overload
from typing_extensions import Literal
@@ -198,7 +198,7 @@ def gzip_decode(data: bytes, max_decode: int = ...) -> bytes: ... # undocumente
class GzipDecodedResponse(gzip.GzipFile): # undocumented
io: io.BytesIO
io: BytesIO
def __init__(self, response: SupportsRead[bytes]) -> None: ...
def close(self) -> None: ...