Add C{Full,Unsafe}Loader and UnsafeConstructor (#5988)

This commit is contained in:
Ashley Whetter
2021-08-31 15:50:31 -07:00
committed by GitHub
parent 2d8fe52d08
commit 026405b014
2 changed files with 13 additions and 1 deletions

View File

@@ -70,6 +70,12 @@ class FullConstructor(SafeConstructor):
def construct_python_object_apply(self, suffix, node, newobj=...): ...
def construct_python_object_new(self, suffix, node): ...
class UnsafeConstructor(FullConstructor):
def find_python_module(self, name, mark): ...
def find_python_name(self, name, mark): ...
def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ...
def set_python_instance_state(self, instance, state): ...
class Constructor(SafeConstructor):
def construct_python_str(self, node): ...
def construct_python_unicode(self, node): ...

View File

@@ -1,7 +1,7 @@
from _typeshed import SupportsRead
from typing import IO, Any, Mapping, Sequence, Text, Union
from yaml.constructor import BaseConstructor, Constructor, SafeConstructor
from yaml.constructor import BaseConstructor, Constructor, FullConstructor, SafeConstructor, UnsafeConstructor
from yaml.events import Event
from yaml.nodes import Node
from yaml.representer import BaseRepresenter, Representer, SafeRepresenter
@@ -33,6 +33,12 @@ class CLoader(CParser, SafeConstructor, Resolver):
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream: str | bytes | _Readable) -> None: ...
class CFullLoader(CParser, FullConstructor, Resolver):
def __init__(self, stream: str | bytes | _Readable) -> None: ...
class CUnsafeLoader(CParser, UnsafeConstructor, Resolver):
def __init__(self, stream: str | bytes | _Readable) -> None: ...
class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented
class CEmitter(object):