mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
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:
16
third_party/2and3/yaml/__init__.pyi
vendored
16
third_party/2and3/yaml/__init__.pyi
vendored
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user