aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/yaml-stubs/nodes.pyi
blob: de490db93d1a88c3057d7639ece3001327c95d61 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from typing import Any, ClassVar

from yaml.error import Mark

# Any Unions: Avoid forcing the user to check for None when they know what Node was instantiated with
# Using generics may be overkill without support for default Generics
# Permissive Unions could also be useful here.
class Node:
    tag: str
    value: Any
    start_mark: Mark | Any
    end_mark: Mark | Any
    def __init__(self, tag: str, value, start_mark: Mark | None, end_mark: Mark | None) -> None: ...

class ScalarNode(Node):
    id: ClassVar[str]
    style: str | Any
    def __init__(
        self, tag: str, value, start_mark: Mark | None = None, end_mark: Mark | None = None, style: str | None = None
    ) -> None: ...

class CollectionNode(Node):
    flow_style: bool | Any
    def __init__(
        self, tag: str, value, start_mark: Mark | None = None, end_mark: Mark | None = None, flow_style: bool | None = None
    ) -> None: ...

class SequenceNode(CollectionNode):
    id: ClassVar[str]

class MappingNode(CollectionNode):
    id: ClassVar[str]