From 9f4a8d3df63e50ca84a65177a25ac02630168137 Mon Sep 17 00:00:00 2001 From: David Fisher Date: Fri, 11 Mar 2016 16:01:30 -0800 Subject: [PATCH] Address review feedback --- stdlib/2.7/__builtin__.pyi | 6 +++--- stdlib/2.7/abc.pyi | 4 ++-- stdlib/3/typing.pyi | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/2.7/__builtin__.pyi b/stdlib/2.7/__builtin__.pyi index d55d88ec6..1abfaf00f 100644 --- a/stdlib/2.7/__builtin__.pyi +++ b/stdlib/2.7/__builtin__.pyi @@ -403,8 +403,8 @@ class bytearray(Sequence[int]): def translate(self, table: str) -> bytearray: ... def upper(self) -> bytearray: ... def zfill(self, width: int) -> bytearray: ... - @classmethod - def fromhex(self, x: str) -> bytearray: ... + @staticmethod + def fromhex(x: str) -> bytearray: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... @@ -860,7 +860,7 @@ class file(BinaryIO): def __iter__(self) -> Iterator[str]: ... def read(self, n: int = ...) -> str: ... def __enter__(self) -> BinaryIO: ... - def __exit__(self, t: type, exc: Any, tb: Any) -> bool: ... + def __exit__(self, t: type = None, exc: BaseException = None, tb: Any = None) -> bool: ... def flush(self) -> None: ... def fileno(self) -> int: ... def isatty(self) -> bool: ... diff --git a/stdlib/2.7/abc.pyi b/stdlib/2.7/abc.pyi index 5e9abaa1d..0eb26f018 100644 --- a/stdlib/2.7/abc.pyi +++ b/stdlib/2.7/abc.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Set, Union, Tuple, List +from typing import Any, Dict, Set, Union, Tuple import _weakrefset # mypy has special processing for ABCMeta and abstractmethod. @@ -18,7 +18,7 @@ class ABCMeta(type): _abc_negative_cache = ... # type: _weakrefset.WeakSet _abc_negative_cache_version = ... # type: int _abc_registry = ... # type: _weakrefset.WeakSet - def __init__(self, name: str, bases: List[type], namespace: Dict[Any, Any]) -> None: ... + def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[Any, Any]) -> None: ... def __instancecheck__(cls: "ABCMeta", instance: Any) -> Any: ... def __subclasscheck__(cls: "ABCMeta", subclass: Any) -> Any: ... def _dump_registry(cls: "ABCMeta", *args: Any, **kwargs: Any) -> None: ... diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index cf1c58286..a2bcc4350 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -284,7 +284,7 @@ class IO(Iterable[AnyStr], Generic[AnyStr]): @abstractmethod def __enter__(self) -> 'IO[AnyStr]': ... @abstractmethod - def __exit__(self, t: type, value: Any, traceback: Any) -> bool: ... + def __exit__(self, t: type = None, value: BaseException = None, traceback: Any = None) -> bool: ... class BinaryIO(IO[bytes]): # TODO readinto