mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-29 06:12:13 +08:00
Remove unneeded # noqa comments, fix broken # noqa comments (#7561)
This commit is contained in:
@@ -70,8 +70,8 @@ class object:
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __eq__(self, o: object) -> bool: ...
|
||||
def __ne__(self, o: object) -> bool: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __repr__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __repr__(self) -> str: ... # noqa: Y029
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
@@ -965,7 +965,7 @@ def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ...
|
||||
@overload
|
||||
def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ...
|
||||
def quit(code: object = ...) -> NoReturn: ...
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> list[int]: ... # noqa: F811
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> list[int]: ...
|
||||
def raw_input(__prompt: Any = ...) -> str: ...
|
||||
@overload
|
||||
def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ...
|
||||
|
||||
@@ -28,7 +28,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
Self = TypeVar("Self") # noqa Y001
|
||||
Self = TypeVar("Self") # noqa: Y001
|
||||
|
||||
class IdentityFunction(Protocol):
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
|
||||
@@ -70,8 +70,8 @@ class object:
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __eq__(self, o: object) -> bool: ...
|
||||
def __ne__(self, o: object) -> bool: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __repr__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __repr__(self) -> str: ... # noqa: Y029
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
@@ -965,7 +965,7 @@ def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ...
|
||||
@overload
|
||||
def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ...
|
||||
def quit(code: object = ...) -> NoReturn: ...
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> list[int]: ... # noqa: F811
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> list[int]: ...
|
||||
def raw_input(__prompt: Any = ...) -> str: ...
|
||||
@overload
|
||||
def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ...
|
||||
|
||||
@@ -20,7 +20,7 @@ class StrictVersion(Version):
|
||||
prerelease: tuple[Text, int] | None
|
||||
def __init__(self, vstring: Text | None = ...) -> None: ...
|
||||
def parse(self: Self, vstring: Text) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __cmp__(self: _T, other: _T | str) -> bool: ...
|
||||
|
||||
class LooseVersion(Version):
|
||||
@@ -29,5 +29,5 @@ class LooseVersion(Version):
|
||||
version: tuple[Text | int, ...]
|
||||
def __init__(self, vstring: Text | None = ...) -> None: ...
|
||||
def parse(self: Self, vstring: Text) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __cmp__(self: _T, other: _T | str) -> bool: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import abc
|
||||
from _typeshed import Self
|
||||
from typing import ( # noqa Y022
|
||||
from typing import ( # noqa: Y022
|
||||
TYPE_CHECKING as TYPE_CHECKING,
|
||||
Any,
|
||||
Callable,
|
||||
|
||||
@@ -21,7 +21,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
Self = TypeVar("Self") # noqa Y001
|
||||
Self = TypeVar("Self") # noqa: Y001
|
||||
|
||||
# For partially known annotations. Usually, fields where type annotations
|
||||
# haven't been added are left unannotated, but in some situations this
|
||||
|
||||
@@ -101,8 +101,8 @@ class object:
|
||||
def __delattr__(self, __name: str) -> None: ...
|
||||
def __eq__(self, __o: object) -> bool: ...
|
||||
def __ne__(self, __o: object) -> bool: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __repr__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __repr__(self) -> str: ... # noqa: Y029
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, __format_spec: str) -> str: ...
|
||||
def __getattribute__(self, __name: str) -> Any: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from types import TracebackType
|
||||
from typing import ( # noqa Y027
|
||||
from typing import ( # noqa: Y027
|
||||
IO,
|
||||
Any,
|
||||
AsyncGenerator,
|
||||
@@ -80,7 +80,7 @@ else:
|
||||
|
||||
AbstractContextManager = ContextManager
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import AsyncContextManager # noqa Y022
|
||||
from typing import AsyncContextManager # noqa: Y022
|
||||
|
||||
AbstractAsyncContextManager = AsyncContextManager
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class StrictVersion(Version):
|
||||
prerelease: tuple[str, int] | None
|
||||
def __init__(self, vstring: str | None = ...) -> None: ...
|
||||
def parse(self: Self, vstring: str) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def _cmp(self: Self, other: Self | str) -> bool: ...
|
||||
|
||||
class LooseVersion(Version):
|
||||
@@ -32,5 +32,5 @@ class LooseVersion(Version):
|
||||
version: tuple[str | int, ...]
|
||||
def __init__(self, vstring: str | None = ...) -> None: ...
|
||||
def parse(self: Self, vstring: str) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa Y029
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def _cmp(self: Self, other: Self | str) -> bool: ...
|
||||
|
||||
@@ -659,10 +659,10 @@ if sys.version_info >= (3, 10):
|
||||
@final
|
||||
class NoneType:
|
||||
def __bool__(self) -> Literal[False]: ...
|
||||
EllipsisType = ellipsis # noqa F811 from builtins
|
||||
EllipsisType = ellipsis # noqa: F821 from builtins
|
||||
from builtins import _NotImplementedType
|
||||
|
||||
NotImplementedType = _NotImplementedType # noqa F811 from builtins
|
||||
NotImplementedType = _NotImplementedType
|
||||
@final
|
||||
class UnionType:
|
||||
@property
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import abc
|
||||
import sys
|
||||
from _typeshed import Self as TypeshedSelf # see #6932 for why the alias cannot have a leading underscore
|
||||
from typing import ( # noqa Y022
|
||||
from typing import ( # noqa: Y022,Y027
|
||||
TYPE_CHECKING as TYPE_CHECKING,
|
||||
Any,
|
||||
AsyncContextManager as AsyncContextManager,
|
||||
|
||||
@@ -35,7 +35,7 @@ arm: Any
|
||||
has_refcount_gc: Any
|
||||
contextmanager = contextlib.contextmanager
|
||||
dottedgetter = operator.attrgetter
|
||||
namedtuple = collections.namedtuple # noqa Y024
|
||||
namedtuple = collections.namedtuple # noqa: Y024
|
||||
next = builtins.next
|
||||
|
||||
class FullArgSpec(NamedTuple):
|
||||
|
||||
@@ -43,7 +43,7 @@ async def mkdir(
|
||||
*,
|
||||
dir_fd: int | None = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any = ..., # noqa: F811
|
||||
executor: Any = ...,
|
||||
) -> None: ...
|
||||
async def makedirs(
|
||||
name: StrOrBytesPath, mode: int = ..., exist_ok: bool = ..., *, loop: AbstractEventLoop | None = ..., executor: Any = ...
|
||||
|
||||
@@ -3,7 +3,7 @@ import ast
|
||||
from typing import Any, Generic, Iterable, Iterator, TypeVar
|
||||
|
||||
FLAKE8_ERROR = tuple[int, int, str, type[Any]]
|
||||
TConfig = TypeVar("TConfig") # noqa: Y001
|
||||
TConfig = TypeVar("TConfig") # noqa: Y001 # Name of the TypeVar matches the name at runtime
|
||||
|
||||
class Error:
|
||||
code: str
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import http.client
|
||||
from _typeshed import Self
|
||||
from collections.abc import Generator
|
||||
from typing import Any, TypeVar
|
||||
from typing import Any
|
||||
|
||||
from .error import *
|
||||
|
||||
# Should use _typeshed.Self when google/pytype#952 is fixed.
|
||||
Self = TypeVar("Self") # noqa Y001
|
||||
|
||||
__author__: str
|
||||
__copyright__: str
|
||||
__contributors__: list[str]
|
||||
|
||||
Reference in New Issue
Block a user