Remove unneeded # noqa comments, fix broken # noqa comments (#7561)

This commit is contained in:
Alex Waygood
2022-03-28 22:17:44 +01:00
committed by GitHub
parent 478e7527aa
commit a3245db63c
15 changed files with 25 additions and 27 deletions

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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,

View File

@@ -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

View File

@@ -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: ...

View File

@@ -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

View File

@@ -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: ...

View File

@@ -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

View File

@@ -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,