From 517d2b6012ce5eb24c33c11ed369055e5d8f1ddb Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 23 Nov 2018 18:51:44 +0100 Subject: [PATCH] Remove unneeded ignores (#2624) --- stdlib/2/UserString.pyi | 4 ++-- stdlib/2/_io.pyi | 2 +- stdlib/2/os/path.pyi | 4 ++-- stdlib/2/user.pyi | 2 +- stdlib/2and3/datetime.pyi | 6 +++--- stdlib/3/importlib/machinery.pyi | 8 ++++---- stdlib/3/os/__init__.pyi | 2 +- stdlib/3/os/path.pyi | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/stdlib/2/UserString.pyi b/stdlib/2/UserString.pyi index 82cab2180..8cbbfc124 100644 --- a/stdlib/2/UserString.pyi +++ b/stdlib/2/UserString.pyi @@ -14,9 +14,9 @@ class UserString(Sequence[UserString]): def __hash__(self) -> int: ... def __len__(self) -> int: ... @overload - def __getitem__(self: _UST, i: int) -> _UST: ... # type: ignore + def __getitem__(self: _UST, i: int) -> _UST: ... @overload - def __getitem__(self: _UST, s: slice) -> _UST: ... # type: ignore + def __getitem__(self: _UST, s: slice) -> _UST: ... def __add__(self: _UST, other: Any) -> _UST: ... def __radd__(self: _UST, other: Any) -> _UST: ... def __mul__(self: _UST, other: int) -> _UST: ... diff --git a/stdlib/2/_io.pyi b/stdlib/2/_io.pyi index 37035ae67..dc14839bb 100644 --- a/stdlib/2/_io.pyi +++ b/stdlib/2/_io.pyi @@ -100,7 +100,7 @@ class _RawIOBase(_IOBase): def readall(self) -> str: ... def read(self, n: int = ...) -> str: ... -class FileIO(_RawIOBase, BytesIO): # type: ignore # for __enter__ +class FileIO(_RawIOBase, BytesIO): mode = ... # type: str closefd = ... # type: bool def __init__(self, file: Union[str, int], mode: str = ..., closefd: bool = ...) -> None: ... diff --git a/stdlib/2/os/path.pyi b/stdlib/2/os/path.pyi index 037928c68..eb4a91324 100644 --- a/stdlib/2/os/path.pyi +++ b/stdlib/2/os/path.pyi @@ -137,14 +137,14 @@ if sys.version_info < (3, 0): elif sys.version_info >= (3, 6): # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... # type: ignore + def join(path: _StrPath, *paths: _StrPath) -> Text: ... @overload def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... else: def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... @overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... # type: ignore +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... @overload def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... diff --git a/stdlib/2/user.pyi b/stdlib/2/user.pyi index e6beaa919..e857a3a95 100644 --- a/stdlib/2/user.pyi +++ b/stdlib/2/user.pyi @@ -4,6 +4,6 @@ # Source: https://hg.python.org/cpython/file/2.7/Lib/user.py from typing import Any -def __getattr__(name) -> Any: ... # type: ignore +def __getattr__(name) -> Any: ... home: str pythonrc: str diff --git a/stdlib/2and3/datetime.pyi b/stdlib/2and3/datetime.pyi index 5acc0767c..ac2f07f5a 100644 --- a/stdlib/2and3/datetime.pyi +++ b/stdlib/2and3/datetime.pyi @@ -281,9 +281,9 @@ class datetime(date): def __gt__(self, other: datetime) -> bool: ... # type: ignore def __add__(self, other: timedelta) -> datetime: ... @overload # type: ignore - def __sub__(self, other: datetime) -> timedelta: ... # type: ignore - @overload # type: ignore - def __sub__(self, other: timedelta) -> datetime: ... # type: ignore + def __sub__(self, other: datetime) -> timedelta: ... + @overload + def __sub__(self, other: timedelta) -> datetime: ... def __hash__(self) -> int: ... def weekday(self) -> int: ... def isoweekday(self) -> int: ... diff --git a/stdlib/3/importlib/machinery.pyi b/stdlib/3/importlib/machinery.pyi index 77ff4df36..f42dc20a7 100644 --- a/stdlib/3/importlib/machinery.pyi +++ b/stdlib/3/importlib/machinery.pyi @@ -32,7 +32,7 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, def get_source(cls, fullname: str) -> None: ... # Loader @staticmethod - def module_repr(module: types.ModuleType) -> str: ... # type: ignore + def module_repr(module: types.ModuleType) -> str: ... @classmethod def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... @classmethod @@ -62,12 +62,12 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): def get_source(cls, fullname: str) -> None: ... # Loader @staticmethod - def module_repr(module: types.ModuleType) -> str: ... # type: ignore + def module_repr(module: types.ModuleType) -> str: ... @classmethod def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... @staticmethod - def exec_module(module: types.ModuleType) -> None: ... # type: ignore + def exec_module(module: types.ModuleType) -> None: ... class WindowsRegistryFinder(importlib.abc.MetaPathFinder): @classmethod @@ -113,4 +113,4 @@ class SourcelessFileLoader(importlib.abc.FileLoader, class ExtensionFileLoader(importlib.abc.ExecutionLoader): def get_filename(self, fullname: str) -> importlib.abc._Path: ... - def get_source(self, fullname: str) -> None: ... # type: ignore + def get_source(self, fullname: str) -> None: ... diff --git a/stdlib/3/os/__init__.pyi b/stdlib/3/os/__init__.pyi index a23963241..abb2c06c6 100644 --- a/stdlib/3/os/__init__.pyi +++ b/stdlib/3/os/__init__.pyi @@ -604,7 +604,7 @@ if sys.version_info >= (3, 0): def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... else: class _wrap_close(IO[Text]): - def close(self) -> Optional[int]: ... # type: ignore + def close(self) -> Optional[int]: ... def popen(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> _wrap_close: ... def popen2(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ... def popen3(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text], IO[Text]]: ... diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index 037928c68..eb4a91324 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -137,14 +137,14 @@ if sys.version_info < (3, 0): elif sys.version_info >= (3, 6): # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... # type: ignore + def join(path: _StrPath, *paths: _StrPath) -> Text: ... @overload def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... else: def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... @overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... # type: ignore +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... @overload def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ...