mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Remove unused type: ignore comments (#9801)
This commit is contained in:
@@ -46,7 +46,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
|
||||
def get_pid(self) -> int | None: ... # type: ignore[override]
|
||||
def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore[override]
|
||||
def _check_proc(self) -> None: ... # undocumented
|
||||
def send_signal(self, signal: int) -> None: ... # type: ignore[override]
|
||||
def send_signal(self, signal: int) -> None: ...
|
||||
async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented
|
||||
def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented
|
||||
def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented
|
||||
|
||||
@@ -140,7 +140,7 @@ if sys.version_info >= (3, 10):
|
||||
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
|
||||
]: ...
|
||||
@overload
|
||||
def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = False) -> Future[list[Any]]: ... # type: ignore[misc]
|
||||
def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = False) -> Future[list[Any]]: ...
|
||||
|
||||
else:
|
||||
@overload
|
||||
@@ -230,7 +230,7 @@ else:
|
||||
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
|
||||
]: ...
|
||||
@overload
|
||||
def gather( # type: ignore[misc]
|
||||
def gather(
|
||||
*coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = None, return_exceptions: bool = False
|
||||
) -> Future[list[Any]]: ...
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@ class str(Sequence[str]):
|
||||
@overload
|
||||
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
|
||||
@overload
|
||||
def format(self, *args: object, **kwargs: object) -> str: ... # type: ignore[misc]
|
||||
def format(self, *args: object, **kwargs: object) -> str: ...
|
||||
def format_map(self, map: _FormatMapMapping) -> str: ...
|
||||
def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
@@ -577,7 +577,7 @@ class str(Sequence[str]):
|
||||
@overload
|
||||
def __mod__(self: LiteralString, __x: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ...
|
||||
@overload
|
||||
def __mod__(self, __x: Any) -> str: ... # type: ignore[misc]
|
||||
def __mod__(self, __x: Any) -> str: ...
|
||||
@overload
|
||||
def __mul__(self: LiteralString, __n: SupportsIndex) -> LiteralString: ...
|
||||
@overload
|
||||
@@ -1192,7 +1192,7 @@ class property:
|
||||
def __delete__(self, __instance: Any) -> None: ...
|
||||
|
||||
@final
|
||||
class _NotImplementedType(Any): # type: ignore[misc]
|
||||
class _NotImplementedType(Any):
|
||||
# A little weird, but typing the __call__ as NotImplemented makes the error message
|
||||
# for NotImplemented() much better
|
||||
__call__: NotImplemented # type: ignore[valid-type] # pyright: ignore[reportGeneralTypeIssues]
|
||||
@@ -1613,11 +1613,11 @@ if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def pow(base: int, exp: int, mod: int) -> int: ...
|
||||
@overload
|
||||
def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ... # type: ignore[misc]
|
||||
def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ...
|
||||
@overload
|
||||
def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ... # type: ignore[misc]
|
||||
def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ...
|
||||
@overload
|
||||
def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ... # type: ignore[misc]
|
||||
def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ...
|
||||
# int base & positive-int exp -> int; int base & negative-int exp -> float
|
||||
# return type must be Any as `int | float` causes too many false-positive errors
|
||||
@overload
|
||||
@@ -1650,11 +1650,11 @@ else:
|
||||
@overload
|
||||
def pow(__base: int, __exp: int, __mod: int) -> int: ...
|
||||
@overload
|
||||
def pow(__base: int, __exp: Literal[0], __mod: None = None) -> Literal[1]: ... # type: ignore[misc]
|
||||
def pow(__base: int, __exp: Literal[0], __mod: None = None) -> Literal[1]: ...
|
||||
@overload
|
||||
def pow(__base: int, __exp: _PositiveInteger, __mod: None = None) -> int: ... # type: ignore[misc]
|
||||
def pow(__base: int, __exp: _PositiveInteger, __mod: None = None) -> int: ...
|
||||
@overload
|
||||
def pow(__base: int, __exp: _NegativeInteger, __mod: None = None) -> float: ... # type: ignore[misc]
|
||||
def pow(__base: int, __exp: _NegativeInteger, __mod: None = None) -> float: ...
|
||||
@overload
|
||||
def pow(__base: int, __exp: int, __mod: None = None) -> Any: ...
|
||||
@overload
|
||||
|
||||
@@ -57,9 +57,8 @@ class SequenceMatcher(Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
# mypy thinks the signatures of the overloads overlap, but the types still work fine
|
||||
@overload
|
||||
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ... # type: ignore[misc]
|
||||
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ...
|
||||
@overload
|
||||
def get_close_matches(
|
||||
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = 3, cutoff: float = 0.6
|
||||
|
||||
@@ -4,7 +4,7 @@ from _typeshed import ReadableBuffer
|
||||
class IncrementalEncoder(codecs.IncrementalEncoder):
|
||||
def __init__(self, errors: str = "strict") -> None: ...
|
||||
def encode(self, input: str, final: bool = False) -> bytes: ...
|
||||
def getstate(self) -> int: ... # type: ignore[override]
|
||||
def getstate(self) -> int: ...
|
||||
def setstate(self, state: int) -> None: ... # type: ignore[override]
|
||||
|
||||
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
|
||||
|
||||
@@ -114,7 +114,7 @@ class EnumMeta(ABCMeta):
|
||||
def __bool__(self) -> Literal[True]: ...
|
||||
def __dir__(self) -> list[str]: ...
|
||||
# Simple value lookup
|
||||
@overload # type: ignore[override]
|
||||
@overload
|
||||
def __call__(cls: type[_EnumMemberT], value: Any, names: None = None) -> _EnumMemberT: ...
|
||||
# Functional Enum API
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
@@ -57,8 +57,8 @@ class GNUTranslations(NullTranslations):
|
||||
CONTEXT: str
|
||||
VERSIONS: Sequence[int]
|
||||
|
||||
@overload # ignores incompatible overloads
|
||||
def find( # type: ignore[misc]
|
||||
@overload
|
||||
def find(
|
||||
domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[False] = False
|
||||
) -> str | None: ...
|
||||
@overload
|
||||
|
||||
@@ -174,7 +174,7 @@ class HTTPConnection:
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
# Can be `None` if `.connect()` was not called:
|
||||
sock: ssl.SSLSocket | Any # type: ignore[override]
|
||||
sock: ssl.SSLSocket | Any
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
|
||||
@@ -191,7 +191,7 @@ if sys.version_info >= (3, 9):
|
||||
class TraversableResources(ResourceReader):
|
||||
@abstractmethod
|
||||
def files(self) -> Traversable: ...
|
||||
def open_resource(self, resource: str) -> BufferedReader: ... # type: ignore[override]
|
||||
def open_resource(self, resource: str) -> BufferedReader: ...
|
||||
def resource_path(self, resource: Any) -> NoReturn: ...
|
||||
def is_resource(self, path: str) -> bool: ...
|
||||
def contents(self) -> Iterator[str]: ...
|
||||
|
||||
@@ -664,7 +664,7 @@ class socket(_socket.socket):
|
||||
# Note that the makefile's documented windows-specific behavior is not represented
|
||||
# mode strings with duplicates are intentionally excluded
|
||||
@overload
|
||||
def makefile( # type: ignore[misc]
|
||||
def makefile(
|
||||
self,
|
||||
mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"],
|
||||
buffering: Literal[0],
|
||||
@@ -725,9 +725,9 @@ class socket(_socket.socket):
|
||||
) -> TextIOWrapper: ...
|
||||
def sendfile(self, file: _SendableFile, offset: int = 0, count: int | None = None) -> int: ...
|
||||
@property
|
||||
def family(self) -> AddressFamily: ... # type: ignore[override]
|
||||
def family(self) -> AddressFamily: ...
|
||||
@property
|
||||
def type(self) -> SocketKind: ... # type: ignore[override]
|
||||
def type(self) -> SocketKind: ...
|
||||
def get_inheritable(self) -> bool: ...
|
||||
def set_inheritable(self, inheritable: bool) -> None: ...
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class BaseServer:
|
||||
class TCPServer(BaseServer):
|
||||
if sys.version_info >= (3, 11):
|
||||
allow_reuse_port: bool
|
||||
server_address: _AfInetAddress # type: ignore[assignment]
|
||||
server_address: _AfInetAddress
|
||||
def __init__(
|
||||
self,
|
||||
server_address: _AfInetAddress,
|
||||
|
||||
@@ -254,7 +254,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant.
|
||||
_TC = TypeVar("_TC", bound=Type[object])
|
||||
|
||||
def no_type_check(arg: _F) -> _F: ...
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore[misc]
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
|
||||
|
||||
# Type aliases and type constructors
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class TestCase:
|
||||
# are not using `ParamSpec` intentionally,
|
||||
# because they might be used with explicitly wrong arg types to raise some error in tests.
|
||||
@overload
|
||||
def assertRaises( # type: ignore[misc]
|
||||
def assertRaises(
|
||||
self,
|
||||
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
callable: Callable[..., Any],
|
||||
@@ -144,7 +144,7 @@ class TestCase:
|
||||
self, expected_exception: type[_E] | tuple[type[_E], ...], *, msg: Any = ...
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertRaisesRegex( # type: ignore[misc]
|
||||
def assertRaisesRegex(
|
||||
self,
|
||||
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
expected_regex: str | Pattern[str],
|
||||
@@ -157,7 +157,7 @@ class TestCase:
|
||||
self, expected_exception: type[_E] | tuple[type[_E], ...], expected_regex: str | Pattern[str], *, msg: Any = ...
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertWarns( # type: ignore[misc]
|
||||
def assertWarns(
|
||||
self,
|
||||
expected_warning: type[Warning] | tuple[type[Warning], ...],
|
||||
callable: Callable[_P, Any],
|
||||
@@ -169,7 +169,7 @@ class TestCase:
|
||||
self, expected_warning: type[Warning] | tuple[type[Warning], ...], *, msg: Any = ...
|
||||
) -> _AssertWarnsContext: ...
|
||||
@overload
|
||||
def assertWarnsRegex( # type: ignore[misc]
|
||||
def assertWarnsRegex(
|
||||
self,
|
||||
expected_warning: type[Warning] | tuple[type[Warning], ...],
|
||||
expected_regex: str | Pattern[str],
|
||||
|
||||
@@ -21,7 +21,7 @@ class Cache(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __missing__(self, key: _KT) -> _VT: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload # type: ignore[override]
|
||||
@overload
|
||||
def pop(self, key: _KT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT | _T) -> _VT | _T: ...
|
||||
|
||||
@@ -4,4 +4,4 @@ from .base import Client as Client
|
||||
|
||||
class BackendApplicationClient(Client):
|
||||
grant_type: str
|
||||
def prepare_request_body(self, body: str = ..., scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs): ... # type: ignore[override]
|
||||
def prepare_request_body(self, body: str = ..., scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs): ...
|
||||
|
||||
@@ -5,6 +5,6 @@ from .base import Client as Client
|
||||
class LegacyApplicationClient(Client):
|
||||
grant_type: str
|
||||
def __init__(self, client_id, **kwargs) -> None: ...
|
||||
def prepare_request_body( # type: ignore[override]
|
||||
def prepare_request_body(
|
||||
self, username, password, body: str = ..., scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs
|
||||
): ...
|
||||
|
||||
@@ -5,8 +5,8 @@ from .base import Client as Client
|
||||
|
||||
class MobileApplicationClient(Client):
|
||||
response_type: str
|
||||
def prepare_request_uri( # type: ignore[override]
|
||||
def prepare_request_uri(
|
||||
self, uri, redirect_uri: Incomplete | None = ..., scope: Incomplete | None = ..., state: Incomplete | None = ..., **kwargs
|
||||
): ...
|
||||
token: Any
|
||||
def parse_request_uri_response(self, uri, state: Incomplete | None = ..., scope: Incomplete | None = ...): ... # type: ignore[override]
|
||||
def parse_request_uri_response(self, uri, state: Incomplete | None = ..., scope: Incomplete | None = ...): ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class ServiceApplicationClient(Client):
|
||||
audience: Incomplete | None = ...,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def prepare_request_body( # type: ignore[override]
|
||||
def prepare_request_body(
|
||||
self,
|
||||
private_key: Incomplete | None = ...,
|
||||
subject: Incomplete | None = ...,
|
||||
|
||||
@@ -7,7 +7,7 @@ class WebApplicationClient(Client):
|
||||
grant_type: str
|
||||
code: Any
|
||||
def __init__(self, client_id, code: Incomplete | None = ..., **kwargs) -> None: ...
|
||||
def prepare_request_uri( # type: ignore[override]
|
||||
def prepare_request_uri(
|
||||
self,
|
||||
uri,
|
||||
redirect_uri: Incomplete | None = ...,
|
||||
@@ -17,7 +17,7 @@ class WebApplicationClient(Client):
|
||||
code_challenge_method: str | None = ...,
|
||||
**kwargs,
|
||||
): ...
|
||||
def prepare_request_body( # type: ignore[override]
|
||||
def prepare_request_body(
|
||||
self,
|
||||
code: Incomplete | None = ...,
|
||||
redirect_uri: Incomplete | None = ...,
|
||||
@@ -26,4 +26,4 @@ class WebApplicationClient(Client):
|
||||
code_verifier: str | None = ...,
|
||||
**kwargs,
|
||||
): ...
|
||||
def parse_request_uri_response(self, uri, state: Incomplete | None = ...): ... # type: ignore[override]
|
||||
def parse_request_uri_response(self, uri, state: Incomplete | None = ...): ...
|
||||
|
||||
@@ -132,10 +132,10 @@ class NamedTupleCursor(_cursor):
|
||||
def execute(self, query, vars: Incomplete | None = ...): ...
|
||||
def executemany(self, query, vars): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = ...): ...
|
||||
def fetchone(self) -> NamedTuple | None: ... # type: ignore[override]
|
||||
def fetchone(self) -> NamedTuple | None: ...
|
||||
def fetchmany(self, size: int | None = ...) -> list[NamedTuple]: ... # type: ignore[override]
|
||||
def fetchall(self) -> list[NamedTuple]: ... # type: ignore[override]
|
||||
def __next__(self) -> NamedTuple: ... # type: ignore[override]
|
||||
def __next__(self) -> NamedTuple: ...
|
||||
|
||||
class LoggingConnection(_connection):
|
||||
log: Any
|
||||
|
||||
Reference in New Issue
Block a user