yaml: Update load methods to use Text rather than str (#4533)

Yaml loading accepts bytes and unicode, either directly or via IO.
For python 3, bytes and str work fine, but for Python 2 code this is redundant and limited.
Text instead of str should make type checks more accurate.
This commit is contained in:
kylec1
2020-09-11 18:37:05 -07:00
committed by GitHub
parent b388662302
commit 59586848c9

View File

@@ -26,14 +26,14 @@ def scan(stream, Loader=...): ...
def parse(stream, Loader=...): ...
def compose(stream, Loader=...): ...
def compose_all(stream, Loader=...): ...
def load(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Any: ...
def load_all(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Iterator[Any]: ...
def full_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ...
def full_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ...
def safe_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ...
def safe_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ...
def unsafe_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ...
def unsafe_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ...
def load(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Any: ...
def load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Iterator[Any]: ...
def full_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
def full_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
def safe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
def safe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
def unsafe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
def unsafe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ...
@overload
def serialize_all(