mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
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:
committed by
Łukasz Langa
parent
37a854630c
commit
d43f3be914
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user