Skip to content

Commit 256b3ce

Browse files
srittauJelleZijlstra
authored andcommitted
Remove a bunch of unused imports (#3323)
1 parent a6f146e commit 256b3ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+31
-95
lines changed

stdlib/2/os/path.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/2/os2emxpath.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/2and3/macpath.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/2and3/ntpath.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/2and3/posixpath.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/3.7/contextvars.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union
1+
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar
22

33
_T = TypeVar('_T')
44

stdlib/3/_imp.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Stubs for _imp (Python 3.6)
22

3-
import sys
43
import types
54
from typing import Any, List
65

stdlib/3/_importlib_modulespec.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# _Loader is the PEP-451-defined interface for a loader type/object.
99

1010
from abc import ABCMeta
11-
import sys
1211
from typing import Any, Dict, List, Optional, Protocol
1312

1413
class _Loader(Protocol):

stdlib/3/_operator.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Stubs for _operator (Python 3.5)
22

3-
import sys
43
from typing import AnyStr
54

65
# In reality the import is the other way around, but this way we can keep the operator stub in 2and3

stdlib/3/asyncio/coroutines.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Callable, Generator, List, TypeVar
1+
from typing import Any, Callable, List, TypeVar
22

33
__all__: List[str]
44

stdlib/3/asyncio/futures.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple
2+
from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple
33
from .events import AbstractEventLoop
44
from concurrent.futures import (
55
CancelledError as CancelledError,

stdlib/3/asyncio/locks.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Callable, Generator, Iterable, Iterator, List, Type, TypeVar, Union, Optional, Awaitable
1+
from typing import Any, Callable, Generator, List, Type, TypeVar, Union, Optional, Awaitable
22

33
from .coroutines import coroutine
44
from .events import AbstractEventLoop

stdlib/3/asyncio/queues.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import sys
21
from asyncio.events import AbstractEventLoop
32
from .coroutines import coroutine
4-
from .futures import Future
53
from typing import Any, Generator, Generic, List, TypeVar, Optional
64

75
__all__: List[str]

stdlib/3/asyncio/tasks.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import concurrent.futures
22
import sys
3-
from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable,
4-
Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator,
5-
Optional)
3+
from typing import (
4+
Any, TypeVar, Set, List, TextIO, Union, Tuple, Generic, Generator, Iterable, Awaitable, overload, Iterator, Optional,
5+
)
66
from types import FrameType
77
from .events import AbstractEventLoop
88
from .futures import Future

stdlib/3/asyncio/transports.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from typing import Dict, Any, TypeVar, Mapping, List, Optional, Tuple
2+
from typing import Any, Mapping, List, Optional, Tuple
33
from asyncio.protocols import BaseProtocol
44

55
__all__: List[str]

stdlib/3/email/__init__.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Stubs for email (Python 3.4)
22

3-
from typing import Callable, Optional, IO
4-
import sys
3+
from typing import Callable, IO
54
from email.message import Message
65
from email.policy import Policy
76

stdlib/3/email/feedparser.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Stubs for email.feedparser (Python 3.4)
22

33
from typing import Callable
4-
import sys
54
from email.message import Message
65
from email.policy import Policy
76

stdlib/3/email/message.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import (
44
List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any
55
)
6-
import sys
76
from email.charset import Charset
87
from email.errors import MessageDefect
98
from email.header import Header

stdlib/3/email/parser.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import email.feedparser
44
from email.message import Message
55
from email.policy import Policy
6-
from typing import BinaryIO, Callable, Optional, TextIO
6+
from typing import BinaryIO, Callable, TextIO
77

88
FeedParser = email.feedparser.FeedParser
99
BytesFeedParser = email.feedparser.BytesFeedParser

stdlib/3/email/policy.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from abc import abstractmethod
44
from typing import Any, List, Optional, Tuple, Union, Callable
5-
import sys
65
from email.message import Message
76
from email.errors import MessageDefect
87
from email.header import Header

stdlib/3/encodings/__init__.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import codecs
22

3-
import typing
4-
5-
def search_function(encoding: str) -> codecs.CodecInfo:
6-
...
3+
def search_function(encoding: str) -> codecs.CodecInfo: ...

stdlib/3/functools.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload
32

43
_AnyCallable = Callable[..., Any]

stdlib/3/heapq.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Based on http://docs.python.org/3.2/library/heapq.html
44

5-
import sys
65
from typing import TypeVar, List, Iterable, Any, Callable, Optional
76

87
_T = TypeVar('_T')

stdlib/3/html/parser.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import List, Optional, Tuple
22
from _markupbase import ParserBase
3-
import sys
43

54
class HTMLParser(ParserBase):
65
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...

stdlib/3/http/cookies.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stubs for http.cookies (Python 3.5)
22

3-
from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union, Any
3+
from typing import Generic, Dict, List, Mapping, Optional, TypeVar, Union, Any
44

55
_DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]]
66
_T = TypeVar('_T')

stdlib/3/importlib/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from importlib.abc import Loader
2-
import sys
32
import types
43
from typing import Any, Mapping, Optional, Sequence
54

stdlib/3/importlib/machinery.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import importlib.abc
2-
import sys
32
import types
4-
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
3+
from typing import Any, Callable, List, Optional, Sequence, Tuple
54

65
# ModuleSpec is exported from this module, but for circular import
76
# reasons exists in its own stub file (with Loader and ModuleType).

stdlib/3/io.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ from typing import (
44
import builtins
55
import codecs
66
from mmap import mmap
7-
import sys
87
from types import TracebackType
98
from typing import TypeVar
109

stdlib/3/json/decoder.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from typing import Any, Callable, Dict, List, Optional, Tuple
32

43
class JSONDecodeError(ValueError):

stdlib/3/msvcrt.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22

33
# NOTE: These are incomplete!
44

5-
from typing import overload, BinaryIO, TextIO
6-
75
def get_osfhandle(file: int) -> int: ...
86
def open_osfhandle(handle: int, flags: int) -> int: ...

stdlib/3/multiprocessing/__init__.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Stubs for multiprocessing
22

3-
from typing import (
4-
Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List,
5-
Union, Sequence, Tuple, Type, overload
6-
)
3+
from typing import Any, Callable, Iterable, Mapping, Optional, List, Union, Sequence, Tuple, Type, overload
74

85
from ctypes import _CData
96
from logging import Logger

stdlib/3/multiprocessing/context.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import multiprocessing
55
from multiprocessing import synchronize
66
from multiprocessing import queues
77
import sys
8-
from typing import (
9-
Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type,
10-
Union,
11-
)
8+
from typing import Any, Callable, Iterable, Optional, List, Mapping, Sequence, Type, Union
129

1310
_LockLike = Union[synchronize.Lock, synchronize.RLock]
1411

stdlib/3/multiprocessing/dummy/__init__.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
from typing import Any, Optional, List, Type
1+
from typing import Any, Optional, List
22

33
import array
4-
import sys
54
import threading
65
import weakref
76

8-
from .connection import Pipe
9-
from threading import Lock, RLock, Semaphore, BoundedSemaphore
10-
from threading import Event, Condition, Barrier
117
from queue import Queue
128

139
JoinableQueue = Queue

stdlib/3/multiprocessing/dummy/connection.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, List, Optional, Tuple, Type, TypeVar
1+
from typing import Any, List, Optional, Tuple, TypeVar
22

33
from queue import Queue
44

stdlib/3/multiprocessing/pool.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
from typing import (
2-
Any, Callable, ContextManager, Iterable, Mapping, Optional, List,
3-
Type, TypeVar, Generic, Iterator
4-
)
5-
from types import TracebackType
1+
from typing import Any, Callable, ContextManager, Iterable, Mapping, Optional, List, TypeVar, Generic, Iterator
62

73
_PT = TypeVar('_PT', bound=Pool)
84
_S = TypeVar('_S')

stdlib/3/os/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from io import TextIOWrapper as _TextIOWrapper
55
from posix import listdir as listdir, times_result
66
import sys
77
from typing import (
8-
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
8+
Mapping, MutableMapping, Dict, List, Any, Tuple, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
99
Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager
1010
)
1111

stdlib/3/os/path.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import os
66
import sys
7-
from typing import (
8-
overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO,
9-
TypeVar, Union, Text, Callable, Optional
10-
)
7+
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
118

129
_T = TypeVar('_T')
1310

stdlib/3/posix.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# NOTE: These are incomplete!
44

55
import sys
6-
from typing import List, NamedTuple, Optional, overload, Tuple
6+
from typing import List, NamedTuple, Optional, overload
77

88
from os import stat_result as stat_result
99

stdlib/3/smtplib.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ from email.message import Message as _Message
22
from socket import socket
33
from ssl import SSLContext
44
from types import TracebackType
5-
from typing import (
6-
Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union,
7-
Pattern, Type, Callable, Protocol, overload)
8-
import sys
5+
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, Pattern, Type, Protocol, overload
96

107
_Reply = Tuple[int, bytes]
118
_SendErrs = Dict[str, _Reply]

stdlib/3/stat.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Based on http://docs.python.org/3.2/library/stat.html
44

55
import sys
6-
import typing
76

87
def S_ISDIR(mode: int) -> bool: ...
98
def S_ISCHR(mode: int) -> bool: ...

stdlib/3/string.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Based on http://docs.python.org/3.2/library/string.html
44

5-
from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable
5+
from typing import Mapping, Sequence, Any, Optional, Union, Tuple, Iterable
66

77
ascii_letters: str
88
ascii_lowercase: str

stdlib/3/subprocess.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
# Based on http://docs.python.org/3.6/library/subprocess.html
44
import sys
5-
from typing import (
6-
Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text,
7-
Generic, TypeVar, AnyStr,
8-
overload,
9-
)
5+
from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload
106
from types import TracebackType
117

128
if sys.version_info >= (3, 8):

stdlib/3/unittest/loader.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import unittest.case
32
import unittest.suite
43
import unittest.result

stdlib/3/unittest/result.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, List, Optional, Tuple, Type
1+
from typing import List, Optional, Tuple, Type
22
from types import TracebackType
33
import unittest.case
44

stdlib/3/unittest/runner.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from typing import Callable, Optional, TextIO, Tuple, Type, Union
2-
import sys
32
import unittest.case
43
import unittest.result
54
import unittest.suite

stdlib/3/urllib/parse.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Stubs for urllib.parse
22
from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional
3-
import sys
43

54
_Str = Union[bytes, str]
65

0 commit comments

Comments
 (0)