mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-05 09:27:38 +08:00
Apply fixes, remove duplicates.
Apply fixes to _random, cStringIO, errno, operator, sys, zlib, etc.; also, remove duplicate 2.7/math.pyi, 2.7/marshal.pyi.
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
# Stubs for cStringIO (Python 2.7)
|
||||
# Built from https://docs.python.org/2/library/stringio.html
|
||||
# See https://docs.python.org/2/library/stringio.html
|
||||
|
||||
from typing import IO, List, Iterable, Iterator, Any
|
||||
|
||||
InputType = ... # type: type
|
||||
OutputType = ... # type: type
|
||||
from typing import IO, List, Iterable, Iterator, Any, Union
|
||||
|
||||
class StringIO(IO[str]):
|
||||
softspace = ... # type: int
|
||||
@@ -18,17 +15,24 @@ class StringIO(IO[str]):
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = -1) -> str: ...
|
||||
def write(self, b: str) -> None: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, size: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = None) -> int:
|
||||
raise IOError()
|
||||
def writable(self) -> bool: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
def next(self) -> str: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __iter__(self) -> "InputType": ...
|
||||
def __enter__(self) -> Any: ...
|
||||
def __exit__(self, exc_type: type, exc_val: Any, exc_tb: Any) -> Any: ...
|
||||
# only StringO:
|
||||
def reset() -> None: ...
|
||||
def write(self, b: Union[str, unicode]) -> None: ...
|
||||
def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ...
|
||||
|
||||
InputType = StringIO
|
||||
OutputType = StringIO
|
||||
|
||||
Reference in New Issue
Block a user