From 15b0959cf84ebaca515c57239277fe47230eeece Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 15 May 2021 02:08:37 +0300 Subject: [PATCH] stdlib/@python2: clean imports (#5453) --- stdlib/@python2/Queue.pyi | 1 - stdlib/@python2/SocketServer.pyi | 3 +-- stdlib/@python2/UserString.pyi | 1 - stdlib/@python2/_bisect.pyi | 4 +--- stdlib/@python2/_csv.pyi | 1 - stdlib/@python2/_curses.pyi | 3 +-- stdlib/@python2/_dummy_threading.pyi | 1 - stdlib/@python2/_functools.pyi | 2 +- stdlib/@python2/_heapq.pyi | 1 - stdlib/@python2/_hotshot.pyi | 2 +- stdlib/@python2/_io.pyi | 3 +-- stdlib/@python2/_json.pyi | 2 +- stdlib/@python2/_random.pyi | 1 - stdlib/@python2/_thread.pyi | 2 -- stdlib/@python2/_typeshed/__init__.pyi | 3 +-- stdlib/@python2/_typeshed/tkinter.pyi | 2 -- stdlib/@python2/_warnings.pyi | 1 - stdlib/@python2/_weakref.pyi | 1 - stdlib/@python2/_weakrefset.pyi | 1 - stdlib/@python2/_winreg.pyi | 1 - stdlib/@python2/aifc.pyi | 4 +--- stdlib/@python2/antigravity.pyi | 1 - stdlib/@python2/argparse.pyi | 1 - stdlib/@python2/array.pyi | 1 - stdlib/@python2/asynchat.pyi | 1 - stdlib/@python2/base64.pyi | 1 - stdlib/@python2/binascii.pyi | 3 +-- stdlib/@python2/bz2.pyi | 5 ++--- stdlib/@python2/cProfile.pyi | 1 - stdlib/@python2/cStringIO.pyi | 1 - stdlib/@python2/calendar.pyi | 1 - stdlib/@python2/cmath.pyi | 1 - stdlib/@python2/code.pyi | 1 - stdlib/@python2/codecs.pyi | 1 - stdlib/@python2/contextlib.pyi | 3 +-- stdlib/@python2/crypt.pyi | 3 --- stdlib/@python2/csv.pyi | 1 - stdlib/@python2/datetime.pyi | 3 +-- stdlib/@python2/decimal.pyi | 4 +--- stdlib/@python2/difflib.pyi | 1 - stdlib/@python2/dis.pyi | 2 +- stdlib/@python2/doctest.pyi | 1 - stdlib/@python2/email/__init__.pyi | 2 +- stdlib/@python2/ensurepip/__init__.pyi | 1 - stdlib/@python2/filecmp.pyi | 3 +-- stdlib/@python2/fileinput.pyi | 3 +-- stdlib/@python2/fractions.pyi | 1 - stdlib/@python2/ftplib.pyi | 4 +--- stdlib/@python2/functools.pyi | 3 +-- stdlib/@python2/genericpath.pyi | 2 -- stdlib/@python2/heapq.pyi | 2 +- stdlib/@python2/hmac.pyi | 1 - stdlib/@python2/httplib.pyi | 1 - stdlib/@python2/imaplib.pyi | 4 +--- stdlib/@python2/imghdr.pyi | 2 -- stdlib/@python2/ipaddress.pyi | 1 - stdlib/@python2/itertools.pyi | 2 +- stdlib/@python2/keyword.pyi | 1 - stdlib/@python2/lib2to3/pgen2/token.pyi | 1 - stdlib/@python2/lib2to3/pytree.pyi | 1 - stdlib/@python2/linecache.pyi | 1 - stdlib/@python2/locale.pyi | 2 -- stdlib/@python2/logging/__init__.pyi | 18 +----------------- stdlib/@python2/logging/config.pyi | 6 ++---- stdlib/@python2/logging/handlers.pyi | 5 +---- stdlib/@python2/macpath.pyi | 3 +-- stdlib/@python2/mailbox.pyi | 1 - stdlib/@python2/math.pyi | 3 +-- stdlib/@python2/mimetypes.pyi | 2 +- stdlib/@python2/mmap.pyi | 3 +-- stdlib/@python2/modulefinder.pyi | 3 +-- .../multiprocessing/dummy/__init__.pyi | 7 +------ .../multiprocessing/dummy/connection.pyi | 2 +- stdlib/@python2/nntplib.pyi | 1 - stdlib/@python2/numbers.pyi | 3 +-- stdlib/@python2/opcode.pyi | 3 +-- stdlib/@python2/operator.pyi | 1 - stdlib/@python2/optparse.pyi | 1 - stdlib/@python2/os/__init__.pyi | 2 -- stdlib/@python2/pdb.pyi | 7 ++----- stdlib/@python2/pickle.pyi | 3 +-- stdlib/@python2/pickletools.pyi | 1 - stdlib/@python2/pkgutil.pyi | 3 +-- stdlib/@python2/plistlib.pyi | 3 +-- stdlib/@python2/popen2.pyi | 2 +- stdlib/@python2/poplib.pyi | 4 +--- stdlib/@python2/pprint.pyi | 1 - stdlib/@python2/pstats.pyi | 1 - stdlib/@python2/pty.pyi | 1 - stdlib/@python2/py_compile.pyi | 3 +-- stdlib/@python2/pyclbr.pyi | 1 - stdlib/@python2/pydoc.pyi | 1 - stdlib/@python2/pyexpat/errors.pyi | 3 --- stdlib/@python2/random.pyi | 2 +- stdlib/@python2/re.pyi | 17 +---------------- stdlib/@python2/readline.pyi | 1 - stdlib/@python2/rlcompleter.pyi | 1 - stdlib/@python2/sched.pyi | 3 +-- stdlib/@python2/select.pyi | 3 +-- stdlib/@python2/sets.pyi | 2 +- stdlib/@python2/shutil.pyi | 19 +------------------ stdlib/@python2/signal.pyi | 2 +- stdlib/@python2/smtpd.pyi | 3 +-- stdlib/@python2/sndhdr.pyi | 3 +-- stdlib/@python2/socket.pyi | 3 +-- stdlib/@python2/sqlite3/dbapi2.pyi | 2 -- stdlib/@python2/sre_compile.pyi | 1 - stdlib/@python2/ssl.pyi | 2 +- stdlib/@python2/string.pyi | 2 +- stdlib/@python2/stringold.pyi | 2 +- stdlib/@python2/struct.pyi | 3 +-- stdlib/@python2/subprocess.pyi | 2 +- stdlib/@python2/sunau.pyi | 3 +-- stdlib/@python2/symtable.pyi | 1 - stdlib/@python2/sys.pyi | 4 ++-- stdlib/@python2/tarfile.pyi | 5 ++--- stdlib/@python2/telnetlib.pyi | 1 - stdlib/@python2/threading.pyi | 1 - stdlib/@python2/timeit.pyi | 3 +-- stdlib/@python2/token.pyi | 1 - stdlib/@python2/tokenize.pyi | 2 +- stdlib/@python2/traceback.pyi | 4 +--- stdlib/@python2/turtle.pyi | 1 - stdlib/@python2/typing_extensions.pyi | 1 - stdlib/@python2/unicodedata.pyi | 1 - stdlib/@python2/uu.pyi | 1 - stdlib/@python2/uuid.pyi | 1 - stdlib/@python2/warnings.pyi | 3 +-- stdlib/@python2/wave.pyi | 3 +-- stdlib/@python2/weakref.pyi | 4 ---- stdlib/@python2/wsgiref/handlers.pyi | 3 +-- stdlib/@python2/wsgiref/headers.pyi | 1 - stdlib/@python2/wsgiref/simple_server.pyi | 1 - stdlib/@python2/wsgiref/util.pyi | 1 - stdlib/@python2/wsgiref/validate.pyi | 1 - stdlib/@python2/xml/dom/minidom.pyi | 1 - stdlib/@python2/xml/etree/ElementInclude.pyi | 1 - stdlib/@python2/xml/etree/ElementTree.pyi | 4 +--- stdlib/@python2/xml/sax/__init__.pyi | 3 +-- stdlib/@python2/xml/sax/saxutils.pyi | 1 - stdlib/@python2/xmlrpclib.pyi | 2 +- stdlib/@python2/zipfile.pyi | 19 +------------------ stdlib/@python2/zipimport.pyi | 4 +--- stdlib/@python2/zlib.pyi | 3 +-- 144 files changed, 77 insertions(+), 294 deletions(-) delete mode 100644 stdlib/@python2/_typeshed/tkinter.pyi diff --git a/stdlib/@python2/Queue.pyi b/stdlib/@python2/Queue.pyi index 98dda8722..5297a4b76 100644 --- a/stdlib/@python2/Queue.pyi +++ b/stdlib/@python2/Queue.pyi @@ -1,4 +1,3 @@ -from collections import deque from typing import Any, Deque, Generic, Optional, TypeVar _T = TypeVar("_T") diff --git a/stdlib/@python2/SocketServer.pyi b/stdlib/@python2/SocketServer.pyi index b8a2c14ee..ca6a31a0f 100644 --- a/stdlib/@python2/SocketServer.pyi +++ b/stdlib/@python2/SocketServer.pyi @@ -1,7 +1,6 @@ import sys -import types from socket import SocketType -from typing import Any, BinaryIO, Callable, ClassVar, List, Optional, Text, Tuple, Type, Union +from typing import Any, BinaryIO, Callable, ClassVar, List, Optional, Text, Tuple, Union class BaseServer: address_family: int diff --git a/stdlib/@python2/UserString.pyi b/stdlib/@python2/UserString.pyi index 33de48739..74ab34f6a 100644 --- a/stdlib/@python2/UserString.pyi +++ b/stdlib/@python2/UserString.pyi @@ -1,4 +1,3 @@ -import collections from typing import Any, Iterable, List, MutableSequence, Optional, Sequence, Text, Tuple, TypeVar, Union, overload _UST = TypeVar("_UST", bound=UserString) diff --git a/stdlib/@python2/_bisect.pyi b/stdlib/@python2/_bisect.pyi index 80a0bea73..1e909c2a7 100644 --- a/stdlib/@python2/_bisect.pyi +++ b/stdlib/@python2/_bisect.pyi @@ -1,6 +1,4 @@ -import sys -from _typeshed import SupportsLessThan -from typing import Callable, MutableSequence, Optional, Sequence, TypeVar +from typing import MutableSequence, Optional, Sequence, TypeVar _T = TypeVar("_T") diff --git a/stdlib/@python2/_csv.pyi b/stdlib/@python2/_csv.pyi index 393274f02..e194cc625 100644 --- a/stdlib/@python2/_csv.pyi +++ b/stdlib/@python2/_csv.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union QUOTE_ALL: int diff --git a/stdlib/@python2/_curses.pyi b/stdlib/@python2/_curses.pyi index 2be7c690c..d6c286e37 100644 --- a/stdlib/@python2/_curses.pyi +++ b/stdlib/@python2/_curses.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, BinaryIO, NamedTuple, Optional, Tuple, Union, overload +from typing import IO, Any, BinaryIO, Optional, Tuple, Union, overload _chtype = Union[str, bytes, int] diff --git a/stdlib/@python2/_dummy_threading.pyi b/stdlib/@python2/_dummy_threading.pyi index 6197b6459..bab2acdc8 100644 --- a/stdlib/@python2/_dummy_threading.pyi +++ b/stdlib/@python2/_dummy_threading.pyi @@ -1,4 +1,3 @@ -import sys from types import FrameType, TracebackType from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union diff --git a/stdlib/@python2/_functools.pyi b/stdlib/@python2/_functools.pyi index 697abb782..e68398238 100644 --- a/stdlib/@python2/_functools.pyi +++ b/stdlib/@python2/_functools.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict, Iterable, Optional, Tuple, TypeVar, overload +from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar, overload _T = TypeVar("_T") _S = TypeVar("_S") diff --git a/stdlib/@python2/_heapq.pyi b/stdlib/@python2/_heapq.pyi index f11143114..f02fc470d 100644 --- a/stdlib/@python2/_heapq.pyi +++ b/stdlib/@python2/_heapq.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Callable, Iterable, List, Optional, TypeVar _T = TypeVar("_T") diff --git a/stdlib/@python2/_hotshot.pyi b/stdlib/@python2/_hotshot.pyi index 46c365f4b..b048f6fb8 100644 --- a/stdlib/@python2/_hotshot.pyi +++ b/stdlib/@python2/_hotshot.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Generic, List, Tuple +from typing import Any, Tuple def coverage(a: str) -> Any: ... def logreader(a: str) -> LogReaderType: ... diff --git a/stdlib/@python2/_io.pyi b/stdlib/@python2/_io.pyi index b88f3de0f..4eafef332 100644 --- a/stdlib/@python2/_io.pyi +++ b/stdlib/@python2/_io.pyi @@ -1,6 +1,5 @@ from mmap import mmap -from types import TracebackType -from typing import IO, Any, AnyStr, BinaryIO, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union +from typing import IO, Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union _bytearray_like = Union[bytearray, mmap] diff --git a/stdlib/@python2/_json.pyi b/stdlib/@python2/_json.pyi index 1c8e0409f..a9868b3e6 100644 --- a/stdlib/@python2/_json.pyi +++ b/stdlib/@python2/_json.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Generic, List, Tuple +from typing import Any, Tuple def encode_basestring_ascii(*args, **kwargs) -> str: ... def scanstring(a, b, *args, **kwargs) -> Tuple[Any, ...]: ... diff --git a/stdlib/@python2/_random.pyi b/stdlib/@python2/_random.pyi index 3d1d64769..7c2dd61af 100644 --- a/stdlib/@python2/_random.pyi +++ b/stdlib/@python2/_random.pyi @@ -1,4 +1,3 @@ -import sys from typing import Tuple # Actually Tuple[(int,) * 625] diff --git a/stdlib/@python2/_thread.pyi b/stdlib/@python2/_thread.pyi index 7c7c800b4..46a6c7741 100644 --- a/stdlib/@python2/_thread.pyi +++ b/stdlib/@python2/_thread.pyi @@ -1,5 +1,3 @@ -import sys -from threading import Thread from types import TracebackType from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type diff --git a/stdlib/@python2/_typeshed/__init__.pyi b/stdlib/@python2/_typeshed/__init__.pyi index e041aa02c..a00a9fc94 100644 --- a/stdlib/@python2/_typeshed/__init__.pyi +++ b/stdlib/@python2/_typeshed/__init__.pyi @@ -14,8 +14,7 @@ import array import mmap -import sys -from typing import AbstractSet, Any, Container, Iterable, Protocol, Text, Tuple, TypeVar, Union +from typing import Any, Container, Iterable, Protocol, Text, Tuple, TypeVar, Union from typing_extensions import Literal, final _KT = TypeVar("_KT") diff --git a/stdlib/@python2/_typeshed/tkinter.pyi b/stdlib/@python2/_typeshed/tkinter.pyi deleted file mode 100644 index 835105283..000000000 --- a/stdlib/@python2/_typeshed/tkinter.pyi +++ /dev/null @@ -1,2 +0,0 @@ -import sys -from typing import Optional, Protocol diff --git a/stdlib/@python2/_warnings.pyi b/stdlib/@python2/_warnings.pyi index 2844b0b69..d16637e68 100644 --- a/stdlib/@python2/_warnings.pyi +++ b/stdlib/@python2/_warnings.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Dict, List, Optional, Tuple, Type, Union, overload default_action: str diff --git a/stdlib/@python2/_weakref.pyi b/stdlib/@python2/_weakref.pyi index fae196c72..e8882b6f1 100644 --- a/stdlib/@python2/_weakref.pyi +++ b/stdlib/@python2/_weakref.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Callable, Generic, List, Optional, TypeVar, overload _C = TypeVar("_C", bound=Callable[..., Any]) diff --git a/stdlib/@python2/_weakrefset.pyi b/stdlib/@python2/_weakrefset.pyi index f5f4fc524..99fa3e311 100644 --- a/stdlib/@python2/_weakrefset.pyi +++ b/stdlib/@python2/_weakrefset.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Generic, Iterable, Iterator, MutableSet, Optional, TypeVar, Union _S = TypeVar("_S") diff --git a/stdlib/@python2/_winreg.pyi b/stdlib/@python2/_winreg.pyi index f12186cb3..8e729f687 100644 --- a/stdlib/@python2/_winreg.pyi +++ b/stdlib/@python2/_winreg.pyi @@ -1,4 +1,3 @@ -import sys from types import TracebackType from typing import Any, Optional, Tuple, Type, Union diff --git a/stdlib/@python2/aifc.pyi b/stdlib/@python2/aifc.pyi index b7fc6bdac..4349b11c1 100644 --- a/stdlib/@python2/aifc.pyi +++ b/stdlib/@python2/aifc.pyi @@ -1,6 +1,4 @@ -import sys -from types import TracebackType -from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Type, Union, overload +from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Union, overload from typing_extensions import Literal class Error(Exception): ... diff --git a/stdlib/@python2/antigravity.pyi b/stdlib/@python2/antigravity.pyi index de101117c..e69de29bb 100644 --- a/stdlib/@python2/antigravity.pyi +++ b/stdlib/@python2/antigravity.pyi @@ -1 +0,0 @@ -import sys diff --git a/stdlib/@python2/argparse.pyi b/stdlib/@python2/argparse.pyi index 064549c2e..a3b5528c4 100644 --- a/stdlib/@python2/argparse.pyi +++ b/stdlib/@python2/argparse.pyi @@ -1,4 +1,3 @@ -import sys from typing import ( IO, Any, diff --git a/stdlib/@python2/array.pyi b/stdlib/@python2/array.pyi index af694ad2d..a93742f85 100644 --- a/stdlib/@python2/array.pyi +++ b/stdlib/@python2/array.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload from typing_extensions import Literal diff --git a/stdlib/@python2/asynchat.pyi b/stdlib/@python2/asynchat.pyi index 2fc5bbf07..464eb42ba 100644 --- a/stdlib/@python2/asynchat.pyi +++ b/stdlib/@python2/asynchat.pyi @@ -1,6 +1,5 @@ import asyncore import socket -import sys from abc import abstractmethod from typing import Optional, Sequence, Tuple, Union diff --git a/stdlib/@python2/base64.pyi b/stdlib/@python2/base64.pyi index ca7d1aee5..05c3ec319 100644 --- a/stdlib/@python2/base64.pyi +++ b/stdlib/@python2/base64.pyi @@ -1,4 +1,3 @@ -import sys from typing import IO, Optional, Union _encodable = Union[bytes, unicode] diff --git a/stdlib/@python2/binascii.pyi b/stdlib/@python2/binascii.pyi index c068567f7..b8da269c9 100644 --- a/stdlib/@python2/binascii.pyi +++ b/stdlib/@python2/binascii.pyi @@ -1,5 +1,4 @@ -import sys -from typing import Text, Union +from typing import Text # Python 2 accepts unicode ascii pretty much everywhere. _Bytes = Text diff --git a/stdlib/@python2/bz2.pyi b/stdlib/@python2/bz2.pyi index 77d0f8e21..17d1194cd 100644 --- a/stdlib/@python2/bz2.pyi +++ b/stdlib/@python2/bz2.pyi @@ -1,8 +1,7 @@ import io -import sys from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer -from typing import IO, Any, Iterable, List, Optional, TextIO, TypeVar, Union, overload -from typing_extensions import Literal, SupportsIndex +from typing import IO, Any, Iterable, List, Optional, TypeVar, Union +from typing_extensions import SupportsIndex _PathOrFile = Union[AnyPath, IO[bytes]] _T = TypeVar("_T") diff --git a/stdlib/@python2/cProfile.pyi b/stdlib/@python2/cProfile.pyi index 3d23acf73..b7255a2d9 100644 --- a/stdlib/@python2/cProfile.pyi +++ b/stdlib/@python2/cProfile.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import AnyPath from types import CodeType from typing import Any, Callable, Dict, Optional, Tuple, TypeVar, Union diff --git a/stdlib/@python2/cStringIO.pyi b/stdlib/@python2/cStringIO.pyi index 603ce3f24..8518625fc 100644 --- a/stdlib/@python2/cStringIO.pyi +++ b/stdlib/@python2/cStringIO.pyi @@ -1,5 +1,4 @@ from abc import ABCMeta -from types import TracebackType from typing import IO, Iterable, Iterator, List, Optional, Union, overload # This class isn't actually abstract, but you can't instantiate it diff --git a/stdlib/@python2/calendar.pyi b/stdlib/@python2/calendar.pyi index e10045ad4..1a8cb1657 100644 --- a/stdlib/@python2/calendar.pyi +++ b/stdlib/@python2/calendar.pyi @@ -1,5 +1,4 @@ import datetime -import sys from time import struct_time from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union diff --git a/stdlib/@python2/cmath.pyi b/stdlib/@python2/cmath.pyi index 86f8d012f..1e19687b4 100644 --- a/stdlib/@python2/cmath.pyi +++ b/stdlib/@python2/cmath.pyi @@ -1,4 +1,3 @@ -import sys from typing import SupportsComplex, SupportsFloat, Tuple, Union e: float diff --git a/stdlib/@python2/code.pyi b/stdlib/@python2/code.pyi index b6ee3129b..ea882c9de 100644 --- a/stdlib/@python2/code.pyi +++ b/stdlib/@python2/code.pyi @@ -1,4 +1,3 @@ -import sys from types import CodeType from typing import Any, Callable, Mapping, Optional diff --git a/stdlib/@python2/codecs.pyi b/stdlib/@python2/codecs.pyi index 1132cdd18..8bacab771 100644 --- a/stdlib/@python2/codecs.pyi +++ b/stdlib/@python2/codecs.pyi @@ -1,4 +1,3 @@ -import sys import types from abc import abstractmethod from typing import ( diff --git a/stdlib/@python2/contextlib.pyi b/stdlib/@python2/contextlib.pyi index 3afc41adb..6aabf5a16 100644 --- a/stdlib/@python2/contextlib.pyi +++ b/stdlib/@python2/contextlib.pyi @@ -1,6 +1,5 @@ -import sys from types import TracebackType -from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Type, TypeVar, overload +from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Type, TypeVar from typing_extensions import Protocol _T = TypeVar("_T") diff --git a/stdlib/@python2/crypt.pyi b/stdlib/@python2/crypt.pyi index bab839794..c4036dbe7 100644 --- a/stdlib/@python2/crypt.pyi +++ b/stdlib/@python2/crypt.pyi @@ -1,4 +1 @@ -import sys -from typing import List, Optional, Union - def crypt(word: str, salt: str) -> str: ... diff --git a/stdlib/@python2/csv.pyi b/stdlib/@python2/csv.pyi index 27a94a059..944c04065 100644 --- a/stdlib/@python2/csv.pyi +++ b/stdlib/@python2/csv.pyi @@ -1,4 +1,3 @@ -import sys from _csv import ( QUOTE_ALL as QUOTE_ALL, QUOTE_MINIMAL as QUOTE_MINIMAL, diff --git a/stdlib/@python2/datetime.pyi b/stdlib/@python2/datetime.pyi index 0af202a55..1cc17167a 100644 --- a/stdlib/@python2/datetime.pyi +++ b/stdlib/@python2/datetime.pyi @@ -1,6 +1,5 @@ -import sys from time import struct_time -from typing import AnyStr, ClassVar, NamedTuple, Optional, SupportsAbs, Tuple, Type, TypeVar, Union, overload +from typing import AnyStr, ClassVar, Optional, SupportsAbs, Tuple, Type, TypeVar, Union, overload _S = TypeVar("_S") diff --git a/stdlib/@python2/decimal.pyi b/stdlib/@python2/decimal.pyi index ef5744a49..bee33d9c7 100644 --- a/stdlib/@python2/decimal.pyi +++ b/stdlib/@python2/decimal.pyi @@ -1,7 +1,5 @@ -import numbers -import sys from types import TracebackType -from typing import Any, Container, Dict, List, NamedTuple, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload +from typing import Any, Container, Dict, List, NamedTuple, Optional, Sequence, Text, Tuple, Type, TypeVar, Union _Decimal = Union[Decimal, int] _DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]] diff --git a/stdlib/@python2/difflib.pyi b/stdlib/@python2/difflib.pyi index 188f39bae..02dbbb644 100644 --- a/stdlib/@python2/difflib.pyi +++ b/stdlib/@python2/difflib.pyi @@ -1,4 +1,3 @@ -import sys from typing import ( Any, AnyStr, diff --git a/stdlib/@python2/dis.pyi b/stdlib/@python2/dis.pyi index 4f1dd94cb..a990771cd 100644 --- a/stdlib/@python2/dis.pyi +++ b/stdlib/@python2/dis.pyi @@ -14,7 +14,7 @@ from opcode import ( opmap as opmap, opname as opname, ) -from typing import IO, Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple, Union +from typing import Any, Callable, Dict, Iterator, List, Tuple, Union # Strictly this should not have to include Callable, but mypy doesn't use FunctionType # for functions (python/mypy#3171) diff --git a/stdlib/@python2/doctest.pyi b/stdlib/@python2/doctest.pyi index 5e10f2c5e..b9e0ab392 100644 --- a/stdlib/@python2/doctest.pyi +++ b/stdlib/@python2/doctest.pyi @@ -1,4 +1,3 @@ -import sys import types import unittest from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union diff --git a/stdlib/@python2/email/__init__.pyi b/stdlib/@python2/email/__init__.pyi index 384d9567f..83d9895ca 100644 --- a/stdlib/@python2/email/__init__.pyi +++ b/stdlib/@python2/email/__init__.pyi @@ -1,4 +1,4 @@ -from typing import IO, Any, AnyStr +from typing import IO, AnyStr def message_from_string(s: AnyStr, *args, **kwargs): ... def message_from_bytes(s: str, *args, **kwargs): ... diff --git a/stdlib/@python2/ensurepip/__init__.pyi b/stdlib/@python2/ensurepip/__init__.pyi index fb9daae2d..8a22ef546 100644 --- a/stdlib/@python2/ensurepip/__init__.pyi +++ b/stdlib/@python2/ensurepip/__init__.pyi @@ -1,4 +1,3 @@ -import sys from typing import Optional def version() -> str: ... diff --git a/stdlib/@python2/filecmp.pyi b/stdlib/@python2/filecmp.pyi index 5767ada0b..73fe39580 100644 --- a/stdlib/@python2/filecmp.pyi +++ b/stdlib/@python2/filecmp.pyi @@ -1,5 +1,4 @@ -import sys -from typing import Any, AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union +from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union DEFAULT_IGNORES: List[str] diff --git a/stdlib/@python2/fileinput.pyi b/stdlib/@python2/fileinput.pyi index 44ca18b53..8bea5ce77 100644 --- a/stdlib/@python2/fileinput.pyi +++ b/stdlib/@python2/fileinput.pyi @@ -1,6 +1,5 @@ -import sys from _typeshed import AnyPath -from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union +from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Union def input( files: Union[AnyPath, Iterable[AnyPath], None] = ..., diff --git a/stdlib/@python2/fractions.pyi b/stdlib/@python2/fractions.pyi index a51fcda41..bb60014b3 100644 --- a/stdlib/@python2/fractions.pyi +++ b/stdlib/@python2/fractions.pyi @@ -1,4 +1,3 @@ -import sys from decimal import Decimal from numbers import Integral, Rational, Real from typing import Optional, Tuple, Type, TypeVar, Union, overload diff --git a/stdlib/@python2/ftplib.pyi b/stdlib/@python2/ftplib.pyi index 070ad5088..bdb975fbc 100644 --- a/stdlib/@python2/ftplib.pyi +++ b/stdlib/@python2/ftplib.pyi @@ -1,9 +1,7 @@ -import sys from _typeshed import SupportsRead, SupportsReadline from socket import socket from ssl import SSLContext -from types import TracebackType -from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union +from typing import Any, BinaryIO, Callable, List, Optional, Text, Tuple, Type, TypeVar, Union from typing_extensions import Literal _T = TypeVar("_T") diff --git a/stdlib/@python2/functools.pyi b/stdlib/@python2/functools.pyi index 8b82177b6..dd873708f 100644 --- a/stdlib/@python2/functools.pyi +++ b/stdlib/@python2/functools.pyi @@ -1,5 +1,4 @@ -from abc import ABCMeta, abstractmethod -from typing import Any, Callable, Dict, Generic, Iterable, Optional, Sequence, Tuple, Type, TypeVar, overload +from typing import Any, Callable, Dict, Generic, Iterable, Sequence, Tuple, Type, TypeVar, overload _AnyCallable = Callable[..., Any] diff --git a/stdlib/@python2/genericpath.pyi b/stdlib/@python2/genericpath.pyi index b1815ac56..34bc57e2e 100644 --- a/stdlib/@python2/genericpath.pyi +++ b/stdlib/@python2/genericpath.pyi @@ -1,5 +1,3 @@ -import os -import sys from _typeshed import AnyPath, BytesPath, StrPath, SupportsLessThanT from typing import List, Sequence, Tuple, Union, overload from typing_extensions import Literal diff --git a/stdlib/@python2/heapq.pyi b/stdlib/@python2/heapq.pyi index d6da32d76..8bdb3d23b 100644 --- a/stdlib/@python2/heapq.pyi +++ b/stdlib/@python2/heapq.pyi @@ -1,5 +1,5 @@ from _typeshed import SupportsLessThan -from typing import Any, Callable, Iterable, List, Optional, Protocol, TypeVar +from typing import Callable, Iterable, List, Optional, TypeVar _T = TypeVar("_T") diff --git a/stdlib/@python2/hmac.pyi b/stdlib/@python2/hmac.pyi index dea498f70..7550163b6 100644 --- a/stdlib/@python2/hmac.pyi +++ b/stdlib/@python2/hmac.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import ReadableBuffer from types import ModuleType from typing import Any, AnyStr, Callable, Optional, Union, overload diff --git a/stdlib/@python2/httplib.pyi b/stdlib/@python2/httplib.pyi index 59dc658f7..6901dfc0f 100644 --- a/stdlib/@python2/httplib.pyi +++ b/stdlib/@python2/httplib.pyi @@ -1,5 +1,4 @@ import mimetools -import ssl from typing import Any, Dict, Optional, Protocol class HTTPMessage(mimetools.Message): diff --git a/stdlib/@python2/imaplib.pyi b/stdlib/@python2/imaplib.pyi index 0c25ab563..730636292 100644 --- a/stdlib/@python2/imaplib.pyi +++ b/stdlib/@python2/imaplib.pyi @@ -1,9 +1,7 @@ import subprocess -import sys import time from socket import socket as _socket -from ssl import SSLContext, SSLSocket -from types import TracebackType +from ssl import SSLSocket from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Text, Tuple, Type, Union from typing_extensions import Literal diff --git a/stdlib/@python2/imghdr.pyi b/stdlib/@python2/imghdr.pyi index 77b1fc75e..4a6c3f39e 100644 --- a/stdlib/@python2/imghdr.pyi +++ b/stdlib/@python2/imghdr.pyi @@ -1,5 +1,3 @@ -import os -import sys from typing import Any, BinaryIO, Callable, List, Optional, Protocol, Text, Union, overload class _ReadableBinary(Protocol): diff --git a/stdlib/@python2/ipaddress.pyi b/stdlib/@python2/ipaddress.pyi index a742ac76b..bc38f124b 100644 --- a/stdlib/@python2/ipaddress.pyi +++ b/stdlib/@python2/ipaddress.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Container, Generic, Iterable, Iterator, Optional, SupportsInt, Tuple, TypeVar, overload # Undocumented length constants diff --git a/stdlib/@python2/itertools.pyi b/stdlib/@python2/itertools.pyi index addb41044..63c38980c 100644 --- a/stdlib/@python2/itertools.pyi +++ b/stdlib/@python2/itertools.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Generic, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload +from typing import Any, Callable, Generic, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, overload _T = TypeVar("_T") _S = TypeVar("_S") diff --git a/stdlib/@python2/keyword.pyi b/stdlib/@python2/keyword.pyi index 34d408141..e84ea1c91 100644 --- a/stdlib/@python2/keyword.pyi +++ b/stdlib/@python2/keyword.pyi @@ -1,4 +1,3 @@ -import sys from typing import Sequence, Text def iskeyword(s: Text) -> bool: ... diff --git a/stdlib/@python2/lib2to3/pgen2/token.pyi b/stdlib/@python2/lib2to3/pgen2/token.pyi index a933c291b..3f4e41d49 100644 --- a/stdlib/@python2/lib2to3/pgen2/token.pyi +++ b/stdlib/@python2/lib2to3/pgen2/token.pyi @@ -1,4 +1,3 @@ -import sys from typing import Dict, Text ENDMARKER: int diff --git a/stdlib/@python2/lib2to3/pytree.pyi b/stdlib/@python2/lib2to3/pytree.pyi index 2f52b66d4..48d11f84f 100644 --- a/stdlib/@python2/lib2to3/pytree.pyi +++ b/stdlib/@python2/lib2to3/pytree.pyi @@ -1,4 +1,3 @@ -import sys from lib2to3.pgen2.grammar import Grammar from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union diff --git a/stdlib/@python2/linecache.pyi b/stdlib/@python2/linecache.pyi index 0d455a1df..1e5fd821b 100644 --- a/stdlib/@python2/linecache.pyi +++ b/stdlib/@python2/linecache.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Dict, List, Optional, Text _ModuleGlobals = Dict[str, Any] diff --git a/stdlib/@python2/locale.pyi b/stdlib/@python2/locale.pyi index ecf161154..eb73dfcb6 100644 --- a/stdlib/@python2/locale.pyi +++ b/stdlib/@python2/locale.pyi @@ -1,5 +1,3 @@ -import sys - # workaround for mypy#2010 from __builtin__ import str as _str from decimal import Decimal diff --git a/stdlib/@python2/logging/__init__.pyi b/stdlib/@python2/logging/__init__.pyi index 240215528..242132c82 100644 --- a/stdlib/@python2/logging/__init__.pyi +++ b/stdlib/@python2/logging/__init__.pyi @@ -1,24 +1,8 @@ import threading from _typeshed import StrPath -from string import Template from time import struct_time from types import FrameType, TracebackType -from typing import ( - IO, - Any, - Callable, - Dict, - Iterable, - List, - Mapping, - MutableMapping, - Optional, - Sequence, - Text, - Tuple, - Union, - overload, -) +from typing import IO, Any, Callable, Dict, List, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Union, overload _SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], Tuple[None, None, None]] _ExcInfoType = Union[None, bool, _SysExcInfoType] diff --git a/stdlib/@python2/logging/config.pyi b/stdlib/@python2/logging/config.pyi index 695001221..3d8817b77 100644 --- a/stdlib/@python2/logging/config.pyi +++ b/stdlib/@python2/logging/config.pyi @@ -1,8 +1,6 @@ -from _typeshed import AnyPath, StrPath +from _typeshed import StrPath from threading import Thread -from typing import IO, Any, Callable, Dict, Optional, Union - -from ConfigParser import RawConfigParser +from typing import IO, Any, Dict, Optional, Union _Path = StrPath diff --git a/stdlib/@python2/logging/handlers.pyi b/stdlib/@python2/logging/handlers.pyi index 9403409fc..ed7e6d74d 100644 --- a/stdlib/@python2/logging/handlers.pyi +++ b/stdlib/@python2/logging/handlers.pyi @@ -1,10 +1,7 @@ -import datetime -import ssl from _typeshed import StrPath from logging import FileHandler, Handler, LogRecord -from Queue import Queue from socket import SocketKind, SocketType -from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple, Union +from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union DEFAULT_TCP_LOGGING_PORT: int DEFAULT_UDP_LOGGING_PORT: int diff --git a/stdlib/@python2/macpath.pyi b/stdlib/@python2/macpath.pyi index 259f22d72..b65234ed5 100644 --- a/stdlib/@python2/macpath.pyi +++ b/stdlib/@python2/macpath.pyi @@ -1,5 +1,4 @@ -import sys -from _typeshed import AnyPath, BytesPath, StrPath +from _typeshed import AnyPath from genericpath import ( commonprefix as commonprefix, exists as exists, diff --git a/stdlib/@python2/mailbox.pyi b/stdlib/@python2/mailbox.pyi index 95f069717..db93b78d6 100644 --- a/stdlib/@python2/mailbox.pyi +++ b/stdlib/@python2/mailbox.pyi @@ -1,5 +1,4 @@ import email.message -import sys from _typeshed import AnyPath from types import TracebackType from typing import ( diff --git a/stdlib/@python2/math.pyi b/stdlib/@python2/math.pyi index 7b32d183c..caddcedd8 100644 --- a/stdlib/@python2/math.pyi +++ b/stdlib/@python2/math.pyi @@ -1,5 +1,4 @@ -import sys -from typing import Iterable, Optional, SupportsFloat, SupportsInt, Tuple, overload +from typing import Iterable, SupportsFloat, SupportsInt, Tuple e: float pi: float diff --git a/stdlib/@python2/mimetypes.pyi b/stdlib/@python2/mimetypes.pyi index 4bc9919b2..5412a5c7c 100644 --- a/stdlib/@python2/mimetypes.pyi +++ b/stdlib/@python2/mimetypes.pyi @@ -1,5 +1,5 @@ import sys -from typing import IO, Dict, List, Optional, Sequence, Text, Tuple, Union +from typing import IO, Dict, List, Optional, Sequence, Text, Tuple def guess_type(url: Text, strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ... diff --git a/stdlib/@python2/mmap.pyi b/stdlib/@python2/mmap.pyi index eeaaae1bb..1b8a0202f 100644 --- a/stdlib/@python2/mmap.pyi +++ b/stdlib/@python2/mmap.pyi @@ -1,6 +1,5 @@ import sys -from _typeshed import ReadableBuffer -from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload +from typing import AnyStr, Generic, Optional, Sequence, Union ACCESS_DEFAULT: int ACCESS_READ: int diff --git a/stdlib/@python2/modulefinder.pyi b/stdlib/@python2/modulefinder.pyi index 989c04acb..6fb953242 100644 --- a/stdlib/@python2/modulefinder.pyi +++ b/stdlib/@python2/modulefinder.pyi @@ -1,6 +1,5 @@ -import sys from types import CodeType -from typing import IO, Any, Container, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple +from typing import IO, Any, Container, Dict, Iterable, List, Optional, Sequence, Tuple LOAD_CONST: int # undocumented IMPORT_NAME: int # undocumented diff --git a/stdlib/@python2/multiprocessing/dummy/__init__.pyi b/stdlib/@python2/multiprocessing/dummy/__init__.pyi index 8f6b21240..dd0b5f524 100644 --- a/stdlib/@python2/multiprocessing/dummy/__init__.pyi +++ b/stdlib/@python2/multiprocessing/dummy/__init__.pyi @@ -1,13 +1,8 @@ import array -import itertools -import sys import threading import weakref -from multiprocessing import TimeoutError, cpu_count -from multiprocessing.dummy.connection import Pipe from Queue import Queue -from threading import BoundedSemaphore, Event, Lock, RLock, Semaphore -from typing import Any, List, Optional, Type +from typing import Any, List, Optional class DummyProcess(threading.Thread): _children: weakref.WeakKeyDictionary[Any, Any] diff --git a/stdlib/@python2/multiprocessing/dummy/connection.pyi b/stdlib/@python2/multiprocessing/dummy/connection.pyi index 60e456e39..737890286 100644 --- a/stdlib/@python2/multiprocessing/dummy/connection.pyi +++ b/stdlib/@python2/multiprocessing/dummy/connection.pyi @@ -1,5 +1,5 @@ from Queue import Queue -from typing import Any, List, Optional, Tuple, Type +from typing import Any, List, Optional, Tuple families: List[None] diff --git a/stdlib/@python2/nntplib.pyi b/stdlib/@python2/nntplib.pyi index cb52934f9..21b33f55d 100644 --- a/stdlib/@python2/nntplib.pyi +++ b/stdlib/@python2/nntplib.pyi @@ -1,7 +1,6 @@ import datetime import socket import ssl -import sys from typing import IO, Any, Dict, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union _SelfT = TypeVar("_SelfT", bound=_NNTPBase) diff --git a/stdlib/@python2/numbers.pyi b/stdlib/@python2/numbers.pyi index 796b44366..fa0c0a17b 100644 --- a/stdlib/@python2/numbers.pyi +++ b/stdlib/@python2/numbers.pyi @@ -1,9 +1,8 @@ # Note: these stubs are incomplete. The more complex type # signatures are currently omitted. -import sys from abc import ABCMeta, abstractmethod -from typing import Any, Optional, SupportsFloat, overload +from typing import Any, Optional, SupportsFloat class Number(metaclass=ABCMeta): @abstractmethod diff --git a/stdlib/@python2/opcode.pyi b/stdlib/@python2/opcode.pyi index 9cf646e53..893dd7c7d 100644 --- a/stdlib/@python2/opcode.pyi +++ b/stdlib/@python2/opcode.pyi @@ -1,5 +1,4 @@ -import sys -from typing import Dict, List, Optional, Sequence +from typing import Dict, List, Sequence cmp_op: Sequence[str] hasconst: List[int] diff --git a/stdlib/@python2/operator.pyi b/stdlib/@python2/operator.pyi index 3edc11181..76a8a9b6b 100644 --- a/stdlib/@python2/operator.pyi +++ b/stdlib/@python2/operator.pyi @@ -1,4 +1,3 @@ -import sys from typing import ( Any, Container, diff --git a/stdlib/@python2/optparse.pyi b/stdlib/@python2/optparse.pyi index dddb648c4..62ae8ef8a 100644 --- a/stdlib/@python2/optparse.pyi +++ b/stdlib/@python2/optparse.pyi @@ -1,4 +1,3 @@ -import sys from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type, Union, overload # See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g diff --git a/stdlib/@python2/os/__init__.pyi b/stdlib/@python2/os/__init__.pyi index 0fe13c920..db96359ff 100644 --- a/stdlib/@python2/os/__init__.pyi +++ b/stdlib/@python2/os/__init__.pyi @@ -1,7 +1,6 @@ import sys from _typeshed import AnyPath, FileDescriptorLike from builtins import OSError -from io import TextIOWrapper as _TextIOWrapper from posix import listdir as listdir, stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 from typing import ( IO, @@ -18,7 +17,6 @@ from typing import ( NoReturn, Optional, Sequence, - Set, Text, Tuple, TypeVar, diff --git a/stdlib/@python2/pdb.pyi b/stdlib/@python2/pdb.pyi index 070ca44c4..ba04e4d28 100644 --- a/stdlib/@python2/pdb.pyi +++ b/stdlib/@python2/pdb.pyi @@ -1,10 +1,7 @@ -import signal -import sys from bdb import Bdb from cmd import Cmd -from inspect import _SourceObjectType -from types import CodeType, FrameType, TracebackType -from typing import IO, Any, Callable, ClassVar, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, TypeVar, Union +from types import FrameType, TracebackType +from typing import IO, Any, Callable, ClassVar, Dict, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union _T = TypeVar("_T") diff --git a/stdlib/@python2/pickle.pyi b/stdlib/@python2/pickle.pyi index 4fa3698af..8272caeee 100644 --- a/stdlib/@python2/pickle.pyi +++ b/stdlib/@python2/pickle.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, Callable, Iterable, Iterator, Mapping, Optional, Tuple, Type, Union +from typing import IO, Any, Callable, Iterator, Optional, Tuple, Type, Union HIGHEST_PROTOCOL: int bytes_types: Tuple[Type[Any], ...] # undocumented diff --git a/stdlib/@python2/pickletools.pyi b/stdlib/@python2/pickletools.pyi index ad0606dfc..154aaf174 100644 --- a/stdlib/@python2/pickletools.pyi +++ b/stdlib/@python2/pickletools.pyi @@ -1,4 +1,3 @@ -import sys from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union _Reader = Callable[[IO[bytes]], Any] diff --git a/stdlib/@python2/pkgutil.pyi b/stdlib/@python2/pkgutil.pyi index dc365ccb7..5fefef39b 100644 --- a/stdlib/@python2/pkgutil.pyi +++ b/stdlib/@python2/pkgutil.pyi @@ -1,6 +1,5 @@ -import sys from _typeshed import SupportsRead -from typing import IO, Any, Callable, Iterable, Iterator, List, NamedTuple, Optional, Tuple, Union +from typing import IO, Any, Callable, Iterable, Iterator, List, Optional, Tuple, Union Loader = Any MetaPathFinder = Any diff --git a/stdlib/@python2/plistlib.pyi b/stdlib/@python2/plistlib.pyi index bf1af0b38..23115812a 100644 --- a/stdlib/@python2/plistlib.pyi +++ b/stdlib/@python2/plistlib.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, Dict as DictT, Mapping, MutableMapping, Optional, Text, Type, Union +from typing import IO, Any, Dict as DictT, Mapping, Text, Union _Path = Union[str, Text] diff --git a/stdlib/@python2/popen2.pyi b/stdlib/@python2/popen2.pyi index 5101a6f87..b37a71085 100644 --- a/stdlib/@python2/popen2.pyi +++ b/stdlib/@python2/popen2.pyi @@ -1,4 +1,4 @@ -from typing import Any, Iterable, List, Optional, TextIO, Tuple, TypeVar, Union +from typing import Any, Iterable, Optional, TextIO, Tuple, TypeVar, Union _T = TypeVar("_T") diff --git a/stdlib/@python2/poplib.pyi b/stdlib/@python2/poplib.pyi index ab499da68..603093d41 100644 --- a/stdlib/@python2/poplib.pyi +++ b/stdlib/@python2/poplib.pyi @@ -1,7 +1,5 @@ import socket -import ssl -import sys -from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload +from typing import Any, BinaryIO, List, Optional, Pattern, Text, Tuple, overload _LongResp = Tuple[bytes, List[bytes], int] diff --git a/stdlib/@python2/pprint.pyi b/stdlib/@python2/pprint.pyi index c335b14f1..bdf750407 100644 --- a/stdlib/@python2/pprint.pyi +++ b/stdlib/@python2/pprint.pyi @@ -1,4 +1,3 @@ -import sys from typing import IO, Any, Dict, Optional, Tuple def pformat(object: object, indent: int = ..., width: int = ..., depth: Optional[int] = ...) -> str: ... diff --git a/stdlib/@python2/pstats.pyi b/stdlib/@python2/pstats.pyi index 59eb08730..ee5c0dd1c 100644 --- a/stdlib/@python2/pstats.pyi +++ b/stdlib/@python2/pstats.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import AnyPath from cProfile import Profile as _cProfile from profile import Profile diff --git a/stdlib/@python2/pty.pyi b/stdlib/@python2/pty.pyi index fb9a7772c..93983690f 100644 --- a/stdlib/@python2/pty.pyi +++ b/stdlib/@python2/pty.pyi @@ -1,4 +1,3 @@ -import sys from typing import Callable, Iterable, Tuple, Union _Reader = Callable[[int], bytes] diff --git a/stdlib/@python2/py_compile.pyi b/stdlib/@python2/py_compile.pyi index e648909fb..94a8ace8e 100644 --- a/stdlib/@python2/py_compile.pyi +++ b/stdlib/@python2/py_compile.pyi @@ -1,5 +1,4 @@ -import sys -from typing import AnyStr, List, Optional, Text, Type, Union +from typing import List, Optional, Text, Type, Union _EitherStr = Union[bytes, Text] diff --git a/stdlib/@python2/pyclbr.pyi b/stdlib/@python2/pyclbr.pyi index 164f934d0..855a2963c 100644 --- a/stdlib/@python2/pyclbr.pyi +++ b/stdlib/@python2/pyclbr.pyi @@ -1,4 +1,3 @@ -import sys from typing import Dict, List, Optional, Sequence, Union class Class: diff --git a/stdlib/@python2/pydoc.pyi b/stdlib/@python2/pydoc.pyi index f2ef8c4e7..857ed5a82 100644 --- a/stdlib/@python2/pydoc.pyi +++ b/stdlib/@python2/pydoc.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import SupportsWrite from types import MethodType, ModuleType, TracebackType from typing import ( diff --git a/stdlib/@python2/pyexpat/errors.pyi b/stdlib/@python2/pyexpat/errors.pyi index 61420a6ca..498030fd6 100644 --- a/stdlib/@python2/pyexpat/errors.pyi +++ b/stdlib/@python2/pyexpat/errors.pyi @@ -1,6 +1,3 @@ -import sys -from typing import Dict - XML_ERROR_ABORTED: str XML_ERROR_ASYNC_ENTITY: str XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str diff --git a/stdlib/@python2/random.pyi b/stdlib/@python2/random.pyi index 059bd9360..6fb5d6020 100644 --- a/stdlib/@python2/random.pyi +++ b/stdlib/@python2/random.pyi @@ -1,5 +1,5 @@ import _random -from typing import AbstractSet, Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, Union, overload +from typing import Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, overload _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) diff --git a/stdlib/@python2/re.pyi b/stdlib/@python2/re.pyi index 11e3d02fc..aa770b6b6 100644 --- a/stdlib/@python2/re.pyi +++ b/stdlib/@python2/re.pyi @@ -1,19 +1,4 @@ -from typing import ( - Any, - AnyStr, - Callable, - Dict, - Generic, - Iterator, - List, - Match, - Optional, - Pattern, - Sequence, - Tuple, - Union, - overload, -) +from typing import Any, AnyStr, Callable, Iterator, List, Match, Optional, Pattern, Tuple, Union, overload # ----- re variables and constants ----- DEBUG: int diff --git a/stdlib/@python2/readline.pyi b/stdlib/@python2/readline.pyi index 2335135c4..b0d2cac32 100644 --- a/stdlib/@python2/readline.pyi +++ b/stdlib/@python2/readline.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import AnyPath from typing import Callable, Optional, Sequence diff --git a/stdlib/@python2/rlcompleter.pyi b/stdlib/@python2/rlcompleter.pyi index 12b4b4966..a542c45c9 100644 --- a/stdlib/@python2/rlcompleter.pyi +++ b/stdlib/@python2/rlcompleter.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Dict, Optional, Union _Text = Union[str, unicode] diff --git a/stdlib/@python2/sched.pyi b/stdlib/@python2/sched.pyi index 7775c0507..f718dd7a5 100644 --- a/stdlib/@python2/sched.pyi +++ b/stdlib/@python2/sched.pyi @@ -1,5 +1,4 @@ -import sys -from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple +from typing import Any, Callable, Dict, List, NamedTuple, Text, Tuple class Event(NamedTuple): time: float diff --git a/stdlib/@python2/select.pyi b/stdlib/@python2/select.pyi index ddb3226cc..716c34a37 100644 --- a/stdlib/@python2/select.pyi +++ b/stdlib/@python2/select.pyi @@ -1,7 +1,6 @@ import sys from _typeshed import FileDescriptorLike -from types import TracebackType -from typing import Any, Iterable, List, Optional, Tuple, Type +from typing import Any, Iterable, List, Optional, Tuple if sys.platform != "win32": PIPE_BUF: int diff --git a/stdlib/@python2/sets.pyi b/stdlib/@python2/sets.pyi index e0a652053..1ee3e8b26 100644 --- a/stdlib/@python2/sets.pyi +++ b/stdlib/@python2/sets.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union +from typing import Any, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union _T = TypeVar("_T") _Setlike = Union[BaseSet[_T], Iterable[_T]] diff --git a/stdlib/@python2/shutil.pyi b/stdlib/@python2/shutil.pyi index b4824f484..a1c9cd23b 100644 --- a/stdlib/@python2/shutil.pyi +++ b/stdlib/@python2/shutil.pyi @@ -1,22 +1,5 @@ -import os -import sys from _typeshed import StrPath, SupportsRead, SupportsWrite -from typing import ( - Any, - AnyStr, - Callable, - Iterable, - List, - NamedTuple, - Optional, - Sequence, - Set, - Tuple, - Type, - TypeVar, - Union, - overload, -) +from typing import Any, AnyStr, Callable, Iterable, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union _AnyStr = TypeVar("_AnyStr", str, unicode) _AnyPath = TypeVar("_AnyPath", str, unicode) diff --git a/stdlib/@python2/signal.pyi b/stdlib/@python2/signal.pyi index c33ff19dc..16a8f2d1c 100644 --- a/stdlib/@python2/signal.pyi +++ b/stdlib/@python2/signal.pyi @@ -1,5 +1,5 @@ from types import FrameType -from typing import Any, Callable, Tuple, Union +from typing import Callable, Tuple, Union SIG_DFL: int = ... SIG_IGN: int = ... diff --git a/stdlib/@python2/smtpd.pyi b/stdlib/@python2/smtpd.pyi index 846009faf..33d84ffde 100644 --- a/stdlib/@python2/smtpd.pyi +++ b/stdlib/@python2/smtpd.pyi @@ -1,8 +1,7 @@ import asynchat import asyncore import socket -import sys -from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type, Union +from typing import Any, List, Optional, Text, Tuple, Type, Union _Address = Tuple[str, int] # (host, port) diff --git a/stdlib/@python2/sndhdr.pyi b/stdlib/@python2/sndhdr.pyi index 3345f5f01..5163f8630 100644 --- a/stdlib/@python2/sndhdr.pyi +++ b/stdlib/@python2/sndhdr.pyi @@ -1,6 +1,5 @@ -import sys from _typeshed import AnyPath -from typing import NamedTuple, Optional, Tuple, Union +from typing import Optional, Tuple, Union _SndHeaders = Tuple[str, int, int, int, Union[int, str]] diff --git a/stdlib/@python2/socket.pyi b/stdlib/@python2/socket.pyi index ede9f25b7..787e34bcd 100644 --- a/stdlib/@python2/socket.pyi +++ b/stdlib/@python2/socket.pyi @@ -1,6 +1,5 @@ import sys -from typing import Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, TypeVar, Union, overload -from typing_extensions import Literal +from typing import Any, BinaryIO, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload # ----- Constants ----- # Some socket families are listed in the "Socket families" section of the docs, diff --git a/stdlib/@python2/sqlite3/dbapi2.pyi b/stdlib/@python2/sqlite3/dbapi2.pyi index 6f76aebef..e89ae080a 100644 --- a/stdlib/@python2/sqlite3/dbapi2.pyi +++ b/stdlib/@python2/sqlite3/dbapi2.pyi @@ -1,5 +1,3 @@ -import os -import sys from datetime import date, datetime, time from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union diff --git a/stdlib/@python2/sre_compile.pyi b/stdlib/@python2/sre_compile.pyi index 4afc2f232..23317a918 100644 --- a/stdlib/@python2/sre_compile.pyi +++ b/stdlib/@python2/sre_compile.pyi @@ -1,4 +1,3 @@ -import sys from sre_constants import ( SRE_FLAG_DEBUG as SRE_FLAG_DEBUG, SRE_FLAG_DOTALL as SRE_FLAG_DOTALL, diff --git a/stdlib/@python2/ssl.pyi b/stdlib/@python2/ssl.pyi index 58b7ec575..b9693fa89 100644 --- a/stdlib/@python2/ssl.pyi +++ b/stdlib/@python2/ssl.pyi @@ -1,7 +1,7 @@ import socket import sys from _typeshed import StrPath -from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Type, Union, overload +from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Union, overload from typing_extensions import Literal _PCTRTT = Tuple[Tuple[str, str], ...] diff --git a/stdlib/@python2/string.pyi b/stdlib/@python2/string.pyi index 03a6a2dfd..a2b0a9d25 100644 --- a/stdlib/@python2/string.pyi +++ b/stdlib/@python2/string.pyi @@ -1,4 +1,4 @@ -from typing import Any, AnyStr, Iterable, List, Mapping, Optional, Sequence, Text, Tuple, Union, overload +from typing import Any, AnyStr, Iterable, List, Mapping, Sequence, Text, Tuple, Union, overload ascii_letters: str ascii_lowercase: str diff --git a/stdlib/@python2/stringold.pyi b/stdlib/@python2/stringold.pyi index ea11da725..271da8357 100644 --- a/stdlib/@python2/stringold.pyi +++ b/stdlib/@python2/stringold.pyi @@ -1,4 +1,4 @@ -from typing import AnyStr, Iterable, List, Optional, Type +from typing import AnyStr, Iterable, List, Optional whitespace: str lowercase: str diff --git a/stdlib/@python2/struct.pyi b/stdlib/@python2/struct.pyi index 3b3baf7fb..bf27d1278 100644 --- a/stdlib/@python2/struct.pyi +++ b/stdlib/@python2/struct.pyi @@ -1,7 +1,6 @@ -import sys from array import array from mmap import mmap -from typing import Any, Iterator, Text, Tuple, Union +from typing import Any, Text, Tuple, Union class error(Exception): ... diff --git a/stdlib/@python2/subprocess.pyi b/stdlib/@python2/subprocess.pyi index b3a2e92e7..28a4c0574 100644 --- a/stdlib/@python2/subprocess.pyi +++ b/stdlib/@python2/subprocess.pyi @@ -1,4 +1,4 @@ -from typing import IO, Any, Callable, Generic, List, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union +from typing import IO, Any, Callable, Generic, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union _FILE = Union[None, int, IO[Any]] _TXT = Union[bytes, Text] diff --git a/stdlib/@python2/sunau.pyi b/stdlib/@python2/sunau.pyi index 020fac474..e40ae2181 100644 --- a/stdlib/@python2/sunau.pyi +++ b/stdlib/@python2/sunau.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, NamedTuple, NoReturn, Optional, Text, Tuple, Union +from typing import IO, Any, NoReturn, Optional, Text, Tuple, Union _File = Union[Text, IO[bytes]] diff --git a/stdlib/@python2/symtable.pyi b/stdlib/@python2/symtable.pyi index 8417f5948..c7b8092ae 100644 --- a/stdlib/@python2/symtable.pyi +++ b/stdlib/@python2/symtable.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, List, Optional, Sequence, Text, Tuple def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ... diff --git a/stdlib/@python2/sys.pyi b/stdlib/@python2/sys.pyi index 0136f3456..7852911b6 100644 --- a/stdlib/@python2/sys.pyi +++ b/stdlib/@python2/sys.pyi @@ -1,5 +1,5 @@ -from types import ClassType, FrameType, ModuleType, TracebackType -from typing import IO, Any, BinaryIO, Callable, Dict, List, NoReturn, Optional, Sequence, Text, Tuple, Type, Union, overload +from types import ClassType, FrameType, TracebackType +from typing import IO, Any, Callable, Dict, List, NoReturn, Optional, Text, Tuple, Type, Union # The following type alias are stub-only and do not exist during runtime _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] diff --git a/stdlib/@python2/tarfile.pyi b/stdlib/@python2/tarfile.pyi index bffe894fb..01ae3cdf5 100644 --- a/stdlib/@python2/tarfile.pyi +++ b/stdlib/@python2/tarfile.pyi @@ -1,8 +1,7 @@ import io -import sys -from _typeshed import AnyPath, StrPath +from _typeshed import AnyPath from types import TracebackType -from typing import IO, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Set, Tuple, Type, Union +from typing import IO, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Type, Union # tar constants NUL: bytes diff --git a/stdlib/@python2/telnetlib.pyi b/stdlib/@python2/telnetlib.pyi index d59efc994..388e5a8c9 100644 --- a/stdlib/@python2/telnetlib.pyi +++ b/stdlib/@python2/telnetlib.pyi @@ -1,5 +1,4 @@ import socket -import sys from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union DEBUGLEVEL: int diff --git a/stdlib/@python2/threading.pyi b/stdlib/@python2/threading.pyi index 6197b6459..bab2acdc8 100644 --- a/stdlib/@python2/threading.pyi +++ b/stdlib/@python2/threading.pyi @@ -1,4 +1,3 @@ -import sys from types import FrameType, TracebackType from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union diff --git a/stdlib/@python2/timeit.pyi b/stdlib/@python2/timeit.pyi index da27eefa7..dfb6a7b73 100644 --- a/stdlib/@python2/timeit.pyi +++ b/stdlib/@python2/timeit.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, Union +from typing import IO, Any, Callable, List, Optional, Sequence, Text, Union _str = Union[str, Text] _Timer = Callable[[], float] diff --git a/stdlib/@python2/token.pyi b/stdlib/@python2/token.pyi index 54ddc9315..4ba710470 100644 --- a/stdlib/@python2/token.pyi +++ b/stdlib/@python2/token.pyi @@ -1,4 +1,3 @@ -import sys from typing import Dict ENDMARKER: int diff --git a/stdlib/@python2/tokenize.pyi b/stdlib/@python2/tokenize.pyi index 86d5937d6..98ec01a6c 100644 --- a/stdlib/@python2/tokenize.pyi +++ b/stdlib/@python2/tokenize.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Tuple, Union +from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Tuple __author__: str __credits__: str diff --git a/stdlib/@python2/traceback.pyi b/stdlib/@python2/traceback.pyi index f571f7112..3144fdd67 100644 --- a/stdlib/@python2/traceback.pyi +++ b/stdlib/@python2/traceback.pyi @@ -1,7 +1,5 @@ -import sys -from _typeshed import SupportsWrite from types import FrameType, TracebackType -from typing import IO, Any, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Set, Tuple, Type +from typing import IO, List, Optional, Tuple, Type _PT = Tuple[str, int, str, Optional[str]] diff --git a/stdlib/@python2/turtle.pyi b/stdlib/@python2/turtle.pyi index 1d37087b6..6476c9de0 100644 --- a/stdlib/@python2/turtle.pyi +++ b/stdlib/@python2/turtle.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload # TODO: Replace these aliases once we have Python 2 stubs for the Tkinter module. diff --git a/stdlib/@python2/typing_extensions.pyi b/stdlib/@python2/typing_extensions.pyi index efa22f5aa..2499ae19d 100644 --- a/stdlib/@python2/typing_extensions.pyi +++ b/stdlib/@python2/typing_extensions.pyi @@ -1,5 +1,4 @@ import abc -import sys from typing import ( TYPE_CHECKING as TYPE_CHECKING, Any, diff --git a/stdlib/@python2/unicodedata.pyi b/stdlib/@python2/unicodedata.pyi index 6f2c19d60..19c4a6781 100644 --- a/stdlib/@python2/unicodedata.pyi +++ b/stdlib/@python2/unicodedata.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Text, TypeVar, Union ucd_3_2_0: UCD diff --git a/stdlib/@python2/uu.pyi b/stdlib/@python2/uu.pyi index fc4e3eb2f..69d5754bc 100644 --- a/stdlib/@python2/uu.pyi +++ b/stdlib/@python2/uu.pyi @@ -1,4 +1,3 @@ -import sys from typing import BinaryIO, Optional, Text, Union _File = Union[Text, BinaryIO] diff --git a/stdlib/@python2/uuid.pyi b/stdlib/@python2/uuid.pyi index 8ce48d1ed..791268a18 100644 --- a/stdlib/@python2/uuid.pyi +++ b/stdlib/@python2/uuid.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Optional, Text, Tuple # Because UUID has properties called int and bytes we need to rename these temporarily. diff --git a/stdlib/@python2/warnings.pyi b/stdlib/@python2/warnings.pyi index 290700c5c..a94e9fc86 100644 --- a/stdlib/@python2/warnings.pyi +++ b/stdlib/@python2/warnings.pyi @@ -1,6 +1,5 @@ -import sys from types import ModuleType, TracebackType -from typing import Any, List, Optional, TextIO, Type, Union, overload +from typing import List, Optional, TextIO, Type, Union, overload from typing_extensions import Literal from _warnings import warn as warn, warn_explicit as warn_explicit diff --git a/stdlib/@python2/wave.pyi b/stdlib/@python2/wave.pyi index 038254666..8615d8fad 100644 --- a/stdlib/@python2/wave.pyi +++ b/stdlib/@python2/wave.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Optional, Text, Tuple, Union +from typing import IO, Any, BinaryIO, NoReturn, Optional, Text, Tuple, Union _File = Union[Text, IO[bytes]] diff --git a/stdlib/@python2/weakref.pyi b/stdlib/@python2/weakref.pyi index 0fa2791ec..5e8f4cd12 100644 --- a/stdlib/@python2/weakref.pyi +++ b/stdlib/@python2/weakref.pyi @@ -1,17 +1,13 @@ -import sys -import types from _weakrefset import WeakSet as WeakSet from typing import ( Any, Callable, - Dict, Generic, Iterable, Iterator, List, Mapping, MutableMapping, - Optional, Tuple, Type, TypeVar, diff --git a/stdlib/@python2/wsgiref/handlers.pyi b/stdlib/@python2/wsgiref/handlers.pyi index ce7ea2d5e..e8d32bea3 100644 --- a/stdlib/@python2/wsgiref/handlers.pyi +++ b/stdlib/@python2/wsgiref/handlers.pyi @@ -1,7 +1,6 @@ -import sys from abc import abstractmethod from types import TracebackType -from typing import IO, Callable, Dict, List, MutableMapping, Optional, Text, Tuple, Type +from typing import IO, Callable, List, MutableMapping, Optional, Text, Tuple, Type from .headers import Headers from .types import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment diff --git a/stdlib/@python2/wsgiref/headers.pyi b/stdlib/@python2/wsgiref/headers.pyi index ebdc07053..b1c0d4f56 100644 --- a/stdlib/@python2/wsgiref/headers.pyi +++ b/stdlib/@python2/wsgiref/headers.pyi @@ -1,4 +1,3 @@ -import sys from typing import List, Optional, Pattern, Tuple, overload _HeaderList = List[Tuple[str, str]] diff --git a/stdlib/@python2/wsgiref/simple_server.pyi b/stdlib/@python2/wsgiref/simple_server.pyi index 9cfe0e85b..7e18442f6 100644 --- a/stdlib/@python2/wsgiref/simple_server.pyi +++ b/stdlib/@python2/wsgiref/simple_server.pyi @@ -1,4 +1,3 @@ -import sys from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from typing import List, Optional, Type, TypeVar, overload diff --git a/stdlib/@python2/wsgiref/util.pyi b/stdlib/@python2/wsgiref/util.pyi index b77e9df72..e1179ebab 100644 --- a/stdlib/@python2/wsgiref/util.pyi +++ b/stdlib/@python2/wsgiref/util.pyi @@ -1,4 +1,3 @@ -import sys from typing import IO, Any, Callable, Optional from .types import WSGIEnvironment diff --git a/stdlib/@python2/wsgiref/validate.pyi b/stdlib/@python2/wsgiref/validate.pyi index cd62d785b..5918374d5 100644 --- a/stdlib/@python2/wsgiref/validate.pyi +++ b/stdlib/@python2/wsgiref/validate.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed.wsgi import ErrorStream, InputStream, WSGIApplication from typing import Any, Callable, Iterable, Iterator, NoReturn, Optional diff --git a/stdlib/@python2/xml/dom/minidom.pyi b/stdlib/@python2/xml/dom/minidom.pyi index 47a7227bf..2f5988bf7 100644 --- a/stdlib/@python2/xml/dom/minidom.pyi +++ b/stdlib/@python2/xml/dom/minidom.pyi @@ -1,4 +1,3 @@ -import sys import xml.dom from typing import IO, Any, Optional, Text as _Text, TypeVar, Union from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS diff --git a/stdlib/@python2/xml/etree/ElementInclude.pyi b/stdlib/@python2/xml/etree/ElementInclude.pyi index 60e006c26..c6144e408 100644 --- a/stdlib/@python2/xml/etree/ElementInclude.pyi +++ b/stdlib/@python2/xml/etree/ElementInclude.pyi @@ -1,4 +1,3 @@ -import sys from typing import Callable, Optional, Union from xml.etree.ElementTree import Element diff --git a/stdlib/@python2/xml/etree/ElementTree.pyi b/stdlib/@python2/xml/etree/ElementTree.pyi index d93d00ec3..8292c6e7d 100644 --- a/stdlib/@python2/xml/etree/ElementTree.pyi +++ b/stdlib/@python2/xml/etree/ElementTree.pyi @@ -1,5 +1,4 @@ -import sys -from _typeshed import AnyPath, FileDescriptor, SupportsWrite +from _typeshed import AnyPath, FileDescriptor from typing import ( IO, Any, @@ -20,7 +19,6 @@ from typing import ( Union, overload, ) -from typing_extensions import Literal VERSION: str diff --git a/stdlib/@python2/xml/sax/__init__.pyi b/stdlib/@python2/xml/sax/__init__.pyi index 9fdd4cfe8..f4ad8ba34 100644 --- a/stdlib/@python2/xml/sax/__init__.pyi +++ b/stdlib/@python2/xml/sax/__init__.pyi @@ -1,5 +1,4 @@ -import sys -from typing import IO, Any, Iterable, List, NoReturn, Optional, Text, Union +from typing import IO, Any, List, NoReturn, Optional, Text, Union from xml.sax.handler import ContentHandler, ErrorHandler from xml.sax.xmlreader import Locator, XMLReader diff --git a/stdlib/@python2/xml/sax/saxutils.pyi b/stdlib/@python2/xml/sax/saxutils.pyi index 17b5d278a..3f2671eaa 100644 --- a/stdlib/@python2/xml/sax/saxutils.pyi +++ b/stdlib/@python2/xml/sax/saxutils.pyi @@ -1,4 +1,3 @@ -import sys from _typeshed import SupportsWrite from codecs import StreamReaderWriter, StreamWriter from io import RawIOBase, TextIOBase diff --git a/stdlib/@python2/xmlrpclib.pyi b/stdlib/@python2/xmlrpclib.pyi index 52e36b61a..868de39ee 100644 --- a/stdlib/@python2/xmlrpclib.pyi +++ b/stdlib/@python2/xmlrpclib.pyi @@ -5,7 +5,7 @@ from ssl import SSLContext from StringIO import StringIO from time import struct_time from types import InstanceType -from typing import IO, Any, AnyStr, Callable, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union +from typing import IO, Any, AnyStr, Callable, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, Union _Unmarshaller = Any _timeTuple = Tuple[int, int, int, int, int, int, int, int, int] diff --git a/stdlib/@python2/zipfile.pyi b/stdlib/@python2/zipfile.pyi index 472321be1..043aa5e34 100644 --- a/stdlib/@python2/zipfile.pyi +++ b/stdlib/@python2/zipfile.pyi @@ -1,24 +1,7 @@ import io -import sys from _typeshed import StrPath from types import TracebackType -from typing import ( - IO, - Any, - Callable, - Dict, - Iterable, - Iterator, - List, - Optional, - Pattern, - Protocol, - Sequence, - Text, - Tuple, - Type, - Union, -) +from typing import IO, Any, Callable, Dict, Iterable, List, Optional, Pattern, Protocol, Sequence, Text, Tuple, Type, Union _SZI = Union[Text, ZipInfo] _DT = Tuple[int, int, int, int, int, int] diff --git a/stdlib/@python2/zipimport.pyi b/stdlib/@python2/zipimport.pyi index cf348c655..14aa86bb9 100644 --- a/stdlib/@python2/zipimport.pyi +++ b/stdlib/@python2/zipimport.pyi @@ -1,7 +1,5 @@ -import os -import sys from types import CodeType, ModuleType -from typing import Any, List, Optional, Tuple, Union +from typing import Optional, Union class ZipImportError(ImportError): ... diff --git a/stdlib/@python2/zlib.pyi b/stdlib/@python2/zlib.pyi index 6451801c3..f33777ced 100644 --- a/stdlib/@python2/zlib.pyi +++ b/stdlib/@python2/zlib.pyi @@ -1,6 +1,5 @@ -import sys from array import array -from typing import Any, Optional, Union +from typing import Any, Union DEFLATED: int DEF_MEM_LEVEL: int