mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 01:53:24 +08:00
remove unused type ignore flags (#1346)
Verified that none of those are necessary for pytype.
This commit is contained in:
committed by
Guido van Rossum
parent
c31dcf4088
commit
4f2dd0f446
@@ -212,9 +212,9 @@ class Mapping(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT_co]):
|
||||
def __getitem__(self, k: _KT) -> _VT_co:
|
||||
...
|
||||
# Mixin methods
|
||||
@overload # type: ignore
|
||||
@overload
|
||||
def get(self, k: _KT) -> Optional[_VT_co]: ...
|
||||
@overload # type: ignore
|
||||
@overload
|
||||
def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ...
|
||||
def keys(self) -> list[_KT]: ...
|
||||
def values(self) -> list[_VT_co]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ _T = TypeVar('_T', bound=Enum)
|
||||
_S = TypeVar('_S', bound=Type[Enum])
|
||||
|
||||
class EnumMeta(type, Iterable[Enum], Sized, Reversible[Enum], Container[Enum]):
|
||||
def __iter__(self: Type[_T]) -> Iterator[_T]: ... # type: ignore
|
||||
def __iter__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __reversed__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __contains__(self, member: Any) -> bool: ...
|
||||
def __getitem__(self: Type[_T], name: str) -> _T: ...
|
||||
@@ -45,11 +45,12 @@ if sys.version_info >= (3, 6):
|
||||
def __xor__(self: _T, other: _T) -> _T: ...
|
||||
def __invert__(self: _T) -> _T: ...
|
||||
|
||||
# All `type: ignore` comments below due to IntFlag making the function signatures more permissive.
|
||||
# The `type: ignore` comment is needed because mypy considers the type
|
||||
# signatures of several methods defined in int and Flag to be incompatible.
|
||||
class IntFlag(int, Flag): # type: ignore
|
||||
def __or__(self: _T, other: Union[int, _T]) -> _T: ... # type: ignore
|
||||
def __and__(self: _T, other: Union[int, _T]) -> _T: ... # type: ignore
|
||||
def __xor__(self: _T, other: Union[int, _T]) -> _T: ... # type: ignore
|
||||
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
__ror__ = __or__
|
||||
__rand__ = __and__
|
||||
__rxor__ = __xor__
|
||||
|
||||
@@ -30,9 +30,9 @@ if sys.version_info >= (3, 3):
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
@classmethod
|
||||
def get_code(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_code(cls, fullname: str) -> None: ...
|
||||
@classmethod
|
||||
def get_source(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_source(cls, fullname: str) -> None: ...
|
||||
# Loader
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
@@ -59,9 +59,9 @@ else:
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
@classmethod
|
||||
def get_code(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_code(cls, fullname: str) -> None: ...
|
||||
@classmethod
|
||||
def get_source(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_source(cls, fullname: str) -> None: ...
|
||||
# Loader
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
@@ -87,9 +87,9 @@ if sys.version_info >= (3, 3):
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
@classmethod
|
||||
def get_code(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_code(cls, fullname: str) -> None: ...
|
||||
@classmethod
|
||||
def get_source(cls, fullname: str) -> None: ... # type: ignore
|
||||
def get_source(cls, fullname: str) -> None: ...
|
||||
# Loader
|
||||
@classmethod
|
||||
def load_module(cls, fullname: str) -> types.ModuleType: ...
|
||||
|
||||
@@ -294,9 +294,9 @@ class Mapping(_Collection[_KT], Generic[_KT, _VT_co]):
|
||||
def __getitem__(self, k: _KT) -> _VT_co:
|
||||
...
|
||||
# Mixin methods
|
||||
@overload # type: ignore
|
||||
@overload
|
||||
def get(self, k: _KT) -> Optional[_VT_co]: ...
|
||||
@overload # type: ignore
|
||||
@overload
|
||||
def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ...
|
||||
def items(self) -> AbstractSet[Tuple[_KT, _VT_co]]: ...
|
||||
def keys(self) -> AbstractSet[_KT]: ...
|
||||
|
||||
4
third_party/2and3/pytz/__init__.pyi
vendored
4
third_party/2and3/pytz/__init__.pyi
vendored
@@ -14,9 +14,9 @@ country_names = ... # type: Dict
|
||||
class _UTCclass(datetime.tzinfo):
|
||||
zone = ... # type: str
|
||||
def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ...
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... # type: ignore
|
||||
def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ...
|
||||
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... # type: ignore
|
||||
def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ...
|
||||
def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
|
||||
def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user