Skip to content

Commit 46fb62c

Browse files
committed
yaml.dump(..., stream) is optional
<http://pyyaml.org/wiki/PyYAMLDocumentation#dumping-yaml> > yaml.dump accepts the second *optional* argument, which must be an open > text or binary file. In this case, yaml.dump will write the produced > YAML document into the file. Otherwise, yaml.dump returns the produced > document.
1 parent b261b22 commit 46fb62c

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

third_party/2and3/yaml/__init__.pyi

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Iterator, Sequence, Union, IO
1+
from typing import Any, AnyStr, Iterator, overload, Sequence, Union, IO
22
from yaml.error import * # noqa: F403
33
from yaml.tokens import * # noqa: F403
44
from yaml.events import * # noqa: F403
@@ -22,10 +22,27 @@ def safe_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ...
2222
def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ...
2323
def serialize_all(nodes, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...): ...
2424
def serialize(node, stream=..., Dumper=..., **kwds): ...
25-
def dump_all(documents: Sequence[Any], stream: IO[str]=..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> Any: ...
26-
def dump(data: Any, stream: IO[str]=..., Dumper=..., **kwds) -> Any: ...
27-
def safe_dump_all(documents: Sequence[Any], stream: IO[str]=..., **kwds) -> Any: ...
28-
def safe_dump(data: Any, stream: IO[str]=..., **kwds) -> Any: ...
25+
26+
@overload
27+
def dump_all(documents: Sequence[Any], stream: None, Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> AnyStr: ...
28+
@overload
29+
def dump_all(documents: Sequence[Any], stream: IO[str]=..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ...
30+
31+
@overload
32+
def dump(data: Any, stream: None, Dumper=..., **kwds) -> AnyStr: ...
33+
@overload
34+
def dump(data: Any, stream: IO[str]=..., Dumper=..., **kwds) -> None: ...
35+
36+
@overload
37+
def safe_dump_all(documents: Sequence[Any], stream: None, **kwds) -> AnyStr: ...
38+
@overload
39+
def safe_dump_all(documents: Sequence[Any], stream: IO[str]=..., **kwds) -> None: ...
40+
41+
@overload
42+
def safe_dump(data: Any, stream: None, **kwds) -> AnyStr: ...
43+
@overload
44+
def safe_dump(data: Any, stream: IO[str]=..., **kwds) -> None: ...
45+
2946
def add_implicit_resolver(tag, regexp, first=..., Loader=..., Dumper=...): ...
3047
def add_path_resolver(tag, path, kind=..., Loader=..., Dumper=...): ...
3148
def add_constructor(tag, constructor, Loader=...): ...

0 commit comments

Comments
 (0)