mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +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
@@ -1,6 +1,6 @@
|
||||
# Stubs for StringIO (Python 2)
|
||||
|
||||
from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List
|
||||
from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional
|
||||
|
||||
class StringIO(IO[AnyStr], Generic[AnyStr]):
|
||||
closed = ... # type: bool
|
||||
@@ -12,13 +12,13 @@ class StringIO(IO[AnyStr], Generic[AnyStr]):
|
||||
def next(self) -> AnyStr: ...
|
||||
def close(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def seek(self, pos: int, mode: int = ...) -> None: ...
|
||||
def seek(self, pos: int, mode: int = ...) -> int: ...
|
||||
def tell(self) -> int: ...
|
||||
def read(self, n: int = ...) -> AnyStr: ...
|
||||
def readline(self, length: int = ...) -> AnyStr: ...
|
||||
def readlines(self, sizehint: int = ...) -> List[AnyStr]: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def write(self, s: AnyStr) -> None: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def write(self, s: AnyStr) -> int: ...
|
||||
def writelines(self, iterable: Iterable[AnyStr]) -> None: ...
|
||||
def flush(self) -> None: ...
|
||||
def getvalue(self) -> AnyStr: ...
|
||||
|
||||
Reference in New Issue
Block a user