Add basic type annotations for YAML load functions (#1657)

These are probably the most common YAML functions, so this should be useful even without type declarations on the rest of the package.
This commit is contained in:
Wilfred Hughes
2017-10-20 18:18:47 +01:00
committed by Matthias Kramm
parent b7dc041f44
commit 72e24b8443

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Iterator, Union, IO
from yaml.error import * # noqa: F403
from yaml.tokens import * # noqa: F403
from yaml.events import * # noqa: F403
@@ -14,10 +14,10 @@ def scan(stream, Loader=...): ...
def parse(stream, Loader=...): ...
def compose(stream, Loader=...): ...
def compose_all(stream, Loader=...): ...
def load(stream, Loader=...): ...
def load_all(stream, Loader=...): ...
def safe_load(stream): ...
def safe_load_all(stream): ...
def load(stream: Union[str, IO[str]], Loader: Loader=...) -> Any: ...
def load_all(stream: Union[str, IO[str]], Loader: Loader=...) -> Iterator[Any]: ...
def safe_load(stream: Union[str, IO[str]]) -> Any: ...
def safe_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ...
def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ...
def serialize_all(nodes, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...): ...
def serialize(node, stream=..., Dumper=..., **kwds): ...