From 77c06d411cee802a8d1ce418b92aa20473763e45 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 27 Oct 2017 09:30:16 -0700 Subject: [PATCH] Remove type annotation from some Loader args (#1695) There were two problems AFAICT: - There are multiple Loader classes without a common base class, so this should really be a union or a protocol. - The argument is supposed to be a class, not an instance. Rather than figuring out a fix (which would probably require some nasty refactoring) I'm just going back to the old situation where these arguments are implicitly annotated with `Any`. See also https://github.com/python/typeshed/pull/1657#pullrequestreview-72049880 --- third_party/2and3/yaml/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/yaml/__init__.pyi b/third_party/2and3/yaml/__init__.pyi index 9a9e9d932..102bc353b 100644 --- a/third_party/2and3/yaml/__init__.pyi +++ b/third_party/2and3/yaml/__init__.pyi @@ -14,8 +14,8 @@ def scan(stream, Loader=...): ... def parse(stream, Loader=...): ... def compose(stream, Loader=...): ... def compose_all(stream, Loader=...): ... -def load(stream: Union[str, IO[str]], Loader: Loader=...) -> Any: ... -def load_all(stream: Union[str, IO[str]], Loader: Loader=...) -> Iterator[Any]: ... +def load(stream: Union[str, IO[str]], Loader=...) -> Any: ... +def load_all(stream: Union[str, IO[str]], 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=...): ...