Add IO protocols to _typeshed (#4230)

This commit is contained in:
Sebastian Rittau
2020-06-14 20:44:48 +02:00
committed by GitHub
parent ef74bee249
commit 51cf2f51b8
21 changed files with 80 additions and 131 deletions

View File

@@ -1,6 +1,7 @@
import sys
from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Protocol, Text, Tuple, Type, Union
from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union
from types import FunctionType, MethodType, ModuleType, TracebackType
from _typeshed import SupportsWrite
if sys.version_info >= (3,):
from reprlib import Repr
else:
@@ -133,12 +134,10 @@ text: TextDoc
html: HTMLDoc
class _OldStyleClass: ...
class _Writable(Protocol):
def write(self, __obj: str) -> Any: ...
def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ...
def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ..., renderer: Optional[Doc] = ...) -> str: ...
def doc(thing: Union[str, object], title: str = ..., forceload: bool = ..., output: Optional[_Writable] = ...) -> None: ...
def doc(thing: Union[str, object], title: str = ..., forceload: bool = ..., output: Optional[SupportsWrite[str]] = ...) -> None: ...
def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ...
def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ...