1- from typing import Any , AnyStr , Iterator , overload , Sequence , Union , IO
1+ from typing import Any , Iterator , overload , Sequence , Union , IO
22from yaml .error import * # noqa: F403
33from yaml .tokens import * # noqa: F403
44from yaml .events import * # noqa: F403
@@ -8,6 +8,14 @@ from yaml.dumper import * # noqa: F403
88from . import resolver # Help mypy a bit; this is implied by loader and dumper
99# TODO: stubs for cyaml?
1010# from cyaml import *
11+ import sys
12+
13+ if sys .version_info < (3 ,):
14+ _Str = Union [Text , str ]
15+ else :
16+ _Str = str
17+ # FIXME: the functions really return py2:unicode/py3:str if encoding is None, otherwise py2:str/py3:bytes. Waiting for Issue#5621
18+ _Yaml = Any
1119
1220__with_libyaml__ = ... # type: Any
1321
@@ -21,47 +29,35 @@ def safe_load(stream: Union[str, IO[str]]) -> Any: ...
2129def safe_load_all (stream : Union [str , IO [str ]]) -> Iterator [Any ]: ...
2230def emit (events , stream = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ...): ...
2331
24- @overload
25- def serialize_all (nodes , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
26- @overload
27- def serialize_all (nodes , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
2832@overload
2933def serialize_all (nodes , stream : IO [str ], Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
30-
31- @overload
32- def serialize (node , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
3334@overload
34- def serialize (node , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
35- @overload
36- def serialize (node , stream : IO [str ], Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
35+ def serialize_all (nodes , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [_Str ]= ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
3736
3837@overload
39- def dump_all (documents : Sequence [Any ], stream : None = ..., Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
40- @overload
41- def dump_all (documents : Sequence [Any ], stream : None = ..., Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
38+ def serialize (node , stream : IO [str ], Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
4239@overload
43- 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 : ...
40+ def serialize ( node , stream : None = ..., Dumper = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [ _Str ] = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
4441
4542@overload
46- def dump (data : Any , stream : None = ..., Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
47- @overload
48- def dump (data : Any , stream : None = ..., Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
43+ 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 : ...
4944@overload
50- def dump ( data : 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 : ...
45+ def dump_all ( documents : Sequence [ Any ] , stream : None = ... , Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [ _Str ] = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
5146
5247@overload
53- def save_dump_all (documents : Sequence [Any ], stream : None = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
54- @overload
55- def save_dump_all (documents : Sequence [Any ], stream : None = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
48+ def dump (data : 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 : ...
5649@overload
57- def save_dump_all ( documents : Sequence [ Any ] , stream : IO [ str ], default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
50+ def dump ( data : Any , stream : None = ..., Dumper = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [ _Str ] = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
5851
5952@overload
60- def save_dump ( data : Any , stream : None = ... , default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : None = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> str : ...
53+ def save_dump_all ( documents : Sequence [ Any ] , stream : IO [ str ] , default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
6154@overload
62- def save_dump (data : Any , stream : None = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : str = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> bytes : ...
55+ def save_dump_all (documents : Sequence [Any ], stream : None = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [_Str ]= ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
56+
6357@overload
6458def save_dump (data : Any , stream : IO [str ], default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding = ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> None : ...
59+ @overload
60+ def save_dump (data : Any , stream : None = ..., default_style = ..., default_flow_style = ..., canonical = ..., indent = ..., width = ..., allow_unicode = ..., line_break = ..., encoding : Optional [_Str ]= ..., explicit_start = ..., explicit_end = ..., version = ..., tags = ...) -> _Yaml : ...
6561
6662def add_implicit_resolver (tag , regexp , first = ..., Loader = ..., Dumper = ...): ...
6763def add_path_resolver (tag , path , kind = ..., Loader = ..., Dumper = ...): ...
0 commit comments