PyYaml: uncomment commented out imports and add missing classmethod decorators (#1439)

* uncomment yaml imports

* yaml: decorate classmethods
This commit is contained in:
Teemu R
2017-07-01 07:22:55 +02:00
committed by Jelle Zijlstra
parent 9e7953515d
commit 218ce96871
4 changed files with 12 additions and 6 deletions

View File

@@ -1,10 +1,10 @@
from typing import Any
# from yaml.error import *
# from yaml.tokens import *
# from yaml.events import *
# from yaml.nodes import *
# from yaml.loader import *
# from yaml.dumper import *
from yaml.error import * # noqa: F403
from yaml.tokens import * # noqa: F403
from yaml.events import * # noqa: F403
from yaml.nodes import * # noqa: F403
from yaml.loader import * # noqa: F403
from yaml.dumper import * # noqa: F403
# TODO: stubs for cyaml?
# from cyaml import *

View File

@@ -22,7 +22,9 @@ class BaseConstructor:
def construct_sequence(self, node, deep=...): ...
def construct_mapping(self, node, deep=...): ...
def construct_pairs(self, node, deep=...): ...
@classmethod
def add_constructor(cls, tag, constructor): ...
@classmethod
def add_multi_constructor(cls, tag_prefix, multi_constructor): ...
class SafeConstructor(BaseConstructor):

View File

@@ -15,7 +15,9 @@ class BaseRepresenter:
def represent(self, data): ...
def get_classobj_bases(self, cls): ...
def represent_data(self, data): ...
@classmethod
def add_representer(cls, data_type, representer): ...
@classmethod
def add_multi_representer(cls, data_type, representer): ...
def represent_scalar(self, tag, value, style=...): ...
def represent_sequence(self, tag, sequence, flow_style=...): ...

View File

@@ -12,7 +12,9 @@ class BaseResolver:
resolver_exact_paths = ... # type: Any
resolver_prefix_paths = ... # type: Any
def __init__(self) -> None: ...
@classmethod
def add_implicit_resolver(cls, tag, regexp, first): ...
@classmethod
def add_path_resolver(cls, tag, path, kind=...): ...
def descend_resolver(self, current_node, current_index): ...
def ascend_resolver(self): ...