mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 10:51:15 +08:00
Improve several stubs. (math, _random, time, etc.)
Some of these are derived from mypy/stubs/.
This commit is contained in:
@@ -1,43 +1,39 @@
|
||||
"""Stub file for the 'cStringIO' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
# Stubs for cStringIO (Python 2.7)
|
||||
# See https://docs.python.org/2/library/stringio.html
|
||||
|
||||
from typing import Any, List, Tuple, Dict, GenericType
|
||||
from typing import IO, List, Iterable, Iterator, Any, Union
|
||||
|
||||
InputType = ... # type: StringI
|
||||
OutputType = ... # type: StringO
|
||||
cStringIO_CAPI = ... # type: object
|
||||
class StringIO(IO[str]):
|
||||
softspace = ... # type: int
|
||||
|
||||
def StringIO(*args, **kwargs) -> Any: ...
|
||||
|
||||
|
||||
class StringI(object):
|
||||
def close() -> None: ...
|
||||
def flush() -> None: ...
|
||||
def getvalue(*args, **kwargs) -> str: ...
|
||||
def isatty() -> bool: ...
|
||||
def read(*args, **kwargs) -> str: ...
|
||||
def readline(*args, **kwargs) -> str: ...
|
||||
def readlines(*args, **kwargs) -> List[str]: ...
|
||||
def reset() -> None: ...
|
||||
def seek(a: int, *args, **kwargs) -> None: ...
|
||||
def tell() -> int: ...
|
||||
def truncate(*args, **kwargs) -> None:
|
||||
def __init__(self, s: str = None) -> None: ...
|
||||
def getvalue(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = -1) -> str: ...
|
||||
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:
|
||||
raise IOError()
|
||||
|
||||
class StringO(object):
|
||||
def close() -> None: ...
|
||||
def flush() -> None: ...
|
||||
def getvalue(*args, **kwargs) -> str: ...
|
||||
def isatty() -> bool: ...
|
||||
def read(*args, **kwargs) -> str: ...
|
||||
def readline(*args, **kwargs) -> str: ...
|
||||
def readlines(*args, **kwargs) -> List[str]: ...
|
||||
def writable(self) -> bool: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
def next(self) -> str: ...
|
||||
def __iter__(self) -> StringI: ...
|
||||
def __enter__(self) -> Any: ...
|
||||
def __exit__(self, exc_type: type, exc_val: Any, exc_tb: Any) -> Any: ...
|
||||
# only StringO:
|
||||
def reset() -> None: ...
|
||||
def seek(a: int, *args, **kwargs) -> None: ...
|
||||
def tell() -> int: ...
|
||||
def truncate(*args, **kwargs) -> None:
|
||||
raise IOError()
|
||||
def write(a) -> None: ...
|
||||
def writelines(*args, **kwargs) -> 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