mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 21:50:21 +08:00
Removed imported symbols that are not accessed or re-exported (#4387)
Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union
|
||||
|
||||
# TODO recursive type
|
||||
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Based on http://docs.python.org/3.6/library/array.html
|
||||
|
||||
import sys
|
||||
from typing import Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Optional, Tuple
|
||||
|
||||
AdpcmState = Tuple[int, int]
|
||||
RatecvState = Tuple[int, Tuple[Tuple[int, int], ...]]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Stubs for base64
|
||||
|
||||
import sys
|
||||
from typing import IO, Optional, Text, Union
|
||||
from typing import IO, Optional, Union
|
||||
|
||||
if sys.version_info < (3,):
|
||||
_encodable = Union[bytes, unicode]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Stubs for cmd (Python 2/3)
|
||||
|
||||
from typing import IO, Any, Callable, List, Optional, Text, Tuple
|
||||
from typing import IO, Any, Callable, List, Optional, Tuple
|
||||
|
||||
class Cmd:
|
||||
prompt: str
|
||||
|
||||
@@ -6,7 +6,6 @@ from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
ContextManager as ContextManager,
|
||||
Generator,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
|
||||
@@ -18,7 +18,7 @@ from _csv import (
|
||||
writer as writer,
|
||||
)
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type, Union
|
||||
from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type
|
||||
|
||||
_DictRow = Mapping[str, Any]
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ from typing import (
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
Sized,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import List, TypeVar, Union, overload
|
||||
from typing import List, TypeVar, Union
|
||||
|
||||
_Ch = TypeVar("_Ch", str, int)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from distutils.ccompiler import CCompiler
|
||||
from distutils.core import Command as Command
|
||||
from distutils.errors import DistutilsExecError as DistutilsExecError
|
||||
from distutils.sysconfig import customize_compiler as customize_compiler
|
||||
from typing import Any, Dict, List, Match, Optional, Pattern, Sequence, Tuple, Union
|
||||
from typing import Dict, List, Optional, Pattern, Sequence, Tuple, Union
|
||||
|
||||
LANG_EXT: Dict[str, str]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Stubs for distutils.fancy_getopt
|
||||
|
||||
from typing import Any, List, Mapping, Optional, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, List, Mapping, Optional, Tuple, Union, overload
|
||||
|
||||
_Option = Tuple[str, Optional[str], str]
|
||||
_GR = Tuple[List[str], OptionDummy]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Optional, Pattern, Text, Tuple, TypeVar, Union
|
||||
from typing import Optional, Pattern, Text, Tuple, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T", bound=Version)
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Stubs for errno
|
||||
|
||||
import sys
|
||||
from typing import Mapping
|
||||
|
||||
errorcode: Mapping[int, str]
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import sys
|
||||
from decimal import Decimal
|
||||
from numbers import Integral, Rational, Real
|
||||
from typing import Any, Optional, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, Optional, Tuple, Union, overload
|
||||
|
||||
_ComparableNum = Union[int, float, Decimal, Real]
|
||||
|
||||
|
||||
+1
-17
@@ -3,23 +3,7 @@ from _typeshed import SupportsRead, SupportsReadline
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
Any,
|
||||
BinaryIO,
|
||||
Callable,
|
||||
Dict,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
Optional,
|
||||
Text,
|
||||
TextIO,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
)
|
||||
from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_IntOrStr = Union[int, Text]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Sequence, Text, Union
|
||||
from typing import Sequence, Text
|
||||
|
||||
def iskeyword(s: Text) -> bool: ...
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from lib2to3.pgen2.grammar import _DFAS, Grammar
|
||||
from lib2to3.pytree import _NL, _Convert, _RawNode
|
||||
from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple
|
||||
from typing import Any, List, Optional, Sequence, Set, Text, Tuple
|
||||
|
||||
_Context = Sequence[Any]
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Stubs for lib2to3.pygram (Python 3.6)
|
||||
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from typing import Any
|
||||
|
||||
class Symbols:
|
||||
def __init__(self, grammar: Grammar) -> None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ import sys
|
||||
from _typeshed import StrPath
|
||||
from logging import FileHandler, Handler, LogRecord
|
||||
from socket import SocketType
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from queue import Queue, SimpleQueue
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Stubs for mimetypes
|
||||
|
||||
import sys
|
||||
from typing import IO, AnyStr, Dict, List, Optional, Sequence, Text, Tuple, Union
|
||||
from typing import IO, Dict, List, Optional, Sequence, Text, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from os import PathLike
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import AnyStr, Dict, List, Optional, Tuple, overload
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
class NetrcParseError(Exception):
|
||||
filename: Optional[str]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import socket
|
||||
import ssl
|
||||
import sys
|
||||
from typing import Any, BinaryIO, Dict, List, NoReturn, Optional, Pattern, Text, Tuple, overload
|
||||
from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload
|
||||
|
||||
_LongResp = Tuple[bytes, List[bytes], int]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from types import FunctionType, MethodType, ModuleType, TracebackType
|
||||
from types import MethodType, ModuleType, TracebackType
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
|
||||
@@ -11,7 +11,6 @@ from typing import (
|
||||
Optional,
|
||||
Sequence,
|
||||
Set,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import sys
|
||||
from sre_parse import SubPattern
|
||||
from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, List, Pattern, Tuple, Type, Union
|
||||
|
||||
MAXCODE: int
|
||||
if sys.version_info < (3, 0):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import IO, Any, Dict, List, Optional, Tuple, Union, overload
|
||||
from typing import IO, Any, Dict, List, Optional, Tuple, overload
|
||||
|
||||
def get_config_var(name: str) -> Optional[str]: ...
|
||||
@overload
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union
|
||||
|
||||
# TODO recursive type
|
||||
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import ModuleType, TracebackType
|
||||
from typing import Any, List, NamedTuple, Optional, TextIO, Type, Union, overload
|
||||
from typing import Any, List, Optional, TextIO, Type, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from _warnings import warn as warn, warn_explicit as warn_explicit
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Callable, List, Optional, Sequence, Text, Union
|
||||
from typing import Callable, List, Optional, Sequence, Text, Union
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import IO, Callable, Dict, List, MutableMapping, Optional, Text, Tup
|
||||
|
||||
from .headers import Headers
|
||||
from .types import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from .util import FileWrapper, guess_scheme
|
||||
from .util import FileWrapper
|
||||
|
||||
_exc_info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import sys
|
||||
import xml.sax
|
||||
from typing import IO, Any, Iterable, List, NoReturn, Optional, Text, Union
|
||||
from xml.sax.handler import ContentHandler, ErrorHandler
|
||||
from xml.sax.xmlreader import InputSource, Locator
|
||||
from xml.sax.xmlreader import Locator, XMLReader
|
||||
|
||||
class SAXException(Exception):
|
||||
def __init__(self, msg: str, exception: Optional[Exception] = ...) -> None: ...
|
||||
@@ -24,19 +23,11 @@ class SAXReaderNotAvailable(SAXNotSupportedException): ...
|
||||
default_parser_list: List[str]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def make_parser(parser_list: Iterable[str] = ...) -> xml.sax.xmlreader.XMLReader: ...
|
||||
def make_parser(parser_list: Iterable[str] = ...) -> XMLReader: ...
|
||||
|
||||
else:
|
||||
def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ...
|
||||
def make_parser(parser_list: List[str] = ...) -> XMLReader: ...
|
||||
|
||||
def parse(
|
||||
source: Union[str, IO[str], IO[bytes]],
|
||||
handler: xml.sax.handler.ContentHandler,
|
||||
errorHandler: xml.sax.handler.ErrorHandler = ...,
|
||||
) -> None: ...
|
||||
def parseString(
|
||||
string: Union[bytes, Text],
|
||||
handler: xml.sax.handler.ContentHandler,
|
||||
errorHandler: Optional[xml.sax.handler.ErrorHandler] = ...,
|
||||
) -> None: ...
|
||||
def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ...
|
||||
def parse(source: Union[str, IO[str], IO[bytes]], handler: ContentHandler, errorHandler: ErrorHandler = ...,) -> None: ...
|
||||
def parseString(string: Union[bytes, Text], handler: ContentHandler, errorHandler: Optional[ErrorHandler] = ...,) -> None: ...
|
||||
def _create_parser(parser_name: str) -> XMLReader: ...
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from codecs import StreamReaderWriter, StreamWriter
|
||||
from io import RawIOBase, TextIOBase
|
||||
from typing import Mapping, Optional, Text, TextIO, Union
|
||||
from typing import Mapping, Optional, Text, Union
|
||||
from xml.sax import handler, xmlreader
|
||||
|
||||
def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ...
|
||||
|
||||
Reference in New Issue
Block a user