Skip to content

Commit 885094b

Browse files
committed
clean imports based on pyright output, with script
import sys for line in sys.stdin: filename, lineno, _, message = line.split(":") filename = filename.strip() lineno = int(lineno) - 1 to_remove = message.split('"')[1] lines = open(filename).readlines() if lines[lineno].count(to_remove) == 1: lines[lineno] = lines[lineno].replace(to_remove + ",", "") lines[lineno] = lines[lineno].replace(to_remove, "") open(filename, "w").writelines(lines)
1 parent c1ac285 commit 885094b

File tree

141 files changed

+142
-142
lines changed

Some content is hidden

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

141 files changed

+142
-142
lines changed

stdlib/_codecs.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import codecs
22
import sys
3-
from typing import Any, Callable, Dict, Tuple, Union
3+
from typing import Any, Callable, Dict, Tuple,
44

55
# This type is not exposed; it is defined in unicodeobject.c
66
class _EncodingMap:

stdlib/_csv.pyi

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

33
QUOTE_ALL: int
44
QUOTE_MINIMAL: int

stdlib/_curses.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 IO, Any, BinaryIO, NamedTuple, Union, overload
2+
from typing import IO, Any, BinaryIO, NamedTuple, overload
33

44
_chtype = str | bytes | int
55

stdlib/_dummy_threading.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from types import FrameType, TracebackType
3-
from typing import Any, Callable, Iterable, Mapping, Optional, Type, TypeVar
3+
from typing import Any, Callable, Iterable, Mapping, Type, TypeVar
44

55
# TODO recursive type
66
_TF = Callable[[FrameType, str, Any], Callable[..., Any] | None]

stdlib/_socket.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _typeshed import ReadableBuffer, WriteableBuffer
33
from collections.abc import Iterable
4-
from typing import Any, SupportsInt, Tuple, Union, overload
4+
from typing import Any, SupportsInt, Tuple, overload
55

66
if sys.version_info >= (3, 8):
77
from typing import SupportsIndex

stdlib/_thread.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from threading import Thread
33
from types import TracebackType
4-
from typing import Any, Callable, NoReturn, Optional, Tuple, Type
4+
from typing import Any, Callable, NoReturn, Tuple, Type
55
from typing_extensions import final
66

77
error = RuntimeError

stdlib/_typeshed/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ctypes
77
import mmap
88
import sys
99
from os import PathLike
10-
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, TypeVar, Union
10+
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, TypeVar,
1111
from typing_extensions import Literal, final
1212

1313
_KT = TypeVar("_KT")

stdlib/aifc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _typeshed import Self
33
from types import TracebackType
4-
from typing import IO, Any, NamedTuple, Tuple, Type, Union, overload
4+
from typing import IO, Any, NamedTuple, Tuple, Type, overload
55
from typing_extensions import Literal
66

77
class Error(Exception): ...

stdlib/array.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, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, Union, overload
2+
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, overload
33
from typing_extensions import Literal, SupportsIndex
44

55
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]

stdlib/asyncio/base_events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ from asyncio.tasks import Task
99
from asyncio.transports import BaseTransport
1010
from collections.abc import Iterable
1111
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
12-
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, Union, overload
12+
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, overload
1313
from typing_extensions import Literal
1414

1515
if sys.version_info >= (3, 7):

0 commit comments

Comments
 (0)