Unify stdlib/{2,3}/typing.pyi

Also fix signature of IO.seek, IO.truncate, IO.write, and MutableMapping.update
Fixes #1016

Note: I couldn't put typing.pyi in 2and3 because of an import cycle when adding `import sys` to 2/typing.pyi
This commit is contained in:
David Euresti
2017-03-17 16:02:06 -07:00
committed by Łukasz Langa
parent 37a854630c
commit d43f3be914
8 changed files with 55 additions and 36 deletions

View File

@@ -310,9 +310,9 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
# known to be a Mapping with unknown type parameters, which is closer
# to the behavior we want. See mypy issue #1430.
@overload
def update(self, m: Mapping[_KT, _VT]) -> None: ...
def update(self, m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def update(self, m: Iterable[Tuple[_KT, _VT]]) -> None: ...
def update(self, m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
Text = str
@@ -350,9 +350,8 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
def seekable(self) -> bool: ...
@abstractmethod
def tell(self) -> int: ...
# TODO None should not be compatible with int
@abstractmethod
def truncate(self, size: int = ...) -> int: ...
def truncate(self, size: Optional[int] = ...) -> int: ...
@abstractmethod
def writable(self) -> bool: ...
# TODO buffer objects