From 5c94b5875209329791791e54c0599273ac6ba2c0 Mon Sep 17 00:00:00 2001 From: markedwards Date: Thu, 6 Jun 2019 16:47:39 +0100 Subject: [PATCH] Add FullLoader and FullConstructor classes to yaml (#3035) --- third_party/2and3/yaml/constructor.pyi | 17 +++++++++++++++++ third_party/2and3/yaml/loader.pyi | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/yaml/constructor.pyi b/third_party/2and3/yaml/constructor.pyi index 27bcdbe90..1c3d99861 100644 --- a/third_party/2and3/yaml/constructor.pyi +++ b/third_party/2and3/yaml/constructor.pyi @@ -50,6 +50,23 @@ class SafeConstructor(BaseConstructor): def construct_yaml_object(self, node, cls): ... def construct_undefined(self, node): ... +class FullConstructor(SafeConstructor): + def construct_python_str(self, node): ... + def construct_python_unicode(self, node): ... + def construct_python_bytes(self, node): ... + def construct_python_long(self, node): ... + def construct_python_complex(self, node): ... + def construct_python_tuple(self, node): ... + def find_python_module(self, name, mark, unsafe=...): ... + def find_python_name(self, name, mark, unsafe=...): ... + def construct_python_name(self, suffix, node): ... + def construct_python_module(self, suffix, node): ... + def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=..., unsafe=...): ... + def set_python_instance_state(self, instance, state): ... + def construct_python_object(self, suffix, node): ... + def construct_python_object_apply(self, suffix, node, newobj=...): ... + def construct_python_object_new(self, suffix, node): ... + class Constructor(SafeConstructor): def construct_python_str(self, node): ... def construct_python_unicode(self, node): ... diff --git a/third_party/2and3/yaml/loader.pyi b/third_party/2and3/yaml/loader.pyi index 0e9afeac1..15c3a50da 100644 --- a/third_party/2and3/yaml/loader.pyi +++ b/third_party/2and3/yaml/loader.pyi @@ -2,12 +2,15 @@ from yaml.reader import Reader from yaml.scanner import Scanner from yaml.parser import Parser from yaml.composer import Composer -from yaml.constructor import BaseConstructor, SafeConstructor, Constructor +from yaml.constructor import BaseConstructor, FullConstructor, SafeConstructor, Constructor from yaml.resolver import BaseResolver, Resolver class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream) -> None: ... +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + def __init__(self, stream) -> None: ... + class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): def __init__(self, stream) -> None: ...