Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d3bf41

Browse files
authored
Improve type for yaml composer (#5144)
1 parent 2b9cd1e commit 2d3bf41

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

stubs/PyYAML/yaml/composer.pyi

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
from typing import Any
1+
from typing import Any, Dict, Optional, Union
22

33
from yaml.error import MarkedYAMLError
4+
from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode
45

56
class ComposerError(MarkedYAMLError): ...
67

78
class Composer:
8-
anchors: Any
9+
anchors: Dict[Any, Node]
910
def __init__(self) -> None: ...
10-
def check_node(self): ...
11-
def get_node(self): ...
12-
def get_single_node(self): ...
13-
def compose_document(self): ...
14-
def compose_node(self, parent, index): ...
15-
def compose_scalar_node(self, anchor): ...
16-
def compose_sequence_node(self, anchor): ...
17-
def compose_mapping_node(self, anchor): ...
11+
def check_node(self) -> bool: ...
12+
def get_node(self) -> Optional[Node]: ...
13+
def get_single_node(self) -> Optional[Node]: ...
14+
def compose_document(self) -> Optional[Node]: ...
15+
def compose_node(self, parent: Optional[Node], index: int) -> Optional[Node]: ...
16+
def compose_scalar_node(self, anchor: Dict[Any, Node]) -> ScalarNode: ...
17+
def compose_sequence_node(self, anchor: Dict[Any, Node]) -> SequenceNode: ...
18+
def compose_mapping_node(self, anchor: Dict[Any, Node]) -> MappingNode: ...

0 commit comments

Comments
 (0)