diff --git a/stubs/PyYAML/yaml/__init__.pyi b/stubs/PyYAML/yaml/__init__.pyi index 189ea6812997..021152a6edb9 100644 --- a/stubs/PyYAML/yaml/__init__.pyi +++ b/stubs/PyYAML/yaml/__init__.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator, Mapping from re import Pattern -from typing import Any, TypeVar, overload +from typing import Final, TypeVar, overload from . import resolver as resolver # Help mypy a bit; this is implied by loader and dumper from .constructor import BaseConstructor @@ -8,7 +9,7 @@ from .cyaml import * from .cyaml import _CLoader from .dumper import * from .dumper import _Inf -from .emitter import _WriteStream +from .emitter import _WriteStream, _YAMLObject from .error import * from .events import * from .loader import * @@ -23,25 +24,25 @@ _T = TypeVar("_T") _Constructor = TypeVar("_Constructor", bound=BaseConstructor) _Representer = TypeVar("_Representer", bound=BaseRepresenter) -__with_libyaml__: bool -__version__: str +__with_libyaml__: Final[bool] +__version__: Final[str] def warnings(settings=None): ... def scan(stream, Loader: type[_Loader | _CLoader] = ...): ... def parse(stream, Loader: type[_Loader | _CLoader] = ...): ... def compose(stream, Loader: type[_Loader | _CLoader] = ...): ... def compose_all(stream, Loader: type[_Loader | _CLoader] = ...): ... -def load(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> Any: ... -def load_all(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> Iterator[Any]: ... -def full_load(stream: _ReadStream) -> Any: ... -def full_load_all(stream: _ReadStream) -> Iterator[Any]: ... -def safe_load(stream: _ReadStream) -> Any: ... -def safe_load_all(stream: _ReadStream) -> Iterator[Any]: ... -def unsafe_load(stream: _ReadStream) -> Any: ... -def unsafe_load_all(stream: _ReadStream) -> Iterator[Any]: ... +def load(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> _YAMLObject: ... +def load_all(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> Iterator[_YAMLObject]: ... +def full_load(stream: _ReadStream) -> _YAMLObject: ... +def full_load_all(stream: _ReadStream) -> Iterator[_YAMLObject]: ... +def safe_load(stream: _ReadStream) -> _YAMLObject: ... +def safe_load_all(stream: _ReadStream) -> Iterator[_YAMLObject]: ... +def unsafe_load(stream: _ReadStream) -> _YAMLObject: ... +def unsafe_load_all(stream: _ReadStream) -> Iterator[_YAMLObject]: ... def emit( events, - stream: _WriteStream[Any] | None = None, + stream: _WriteStream[_YAMLObject] | None = None, Dumper=..., canonical: bool | None = None, indent: int | None = None, @@ -53,7 +54,7 @@ def emit( @overload def serialize_all( nodes, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], Dumper=..., *, canonical: bool | None = None, @@ -105,7 +106,7 @@ def serialize_all( @overload def serialize( node, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], Dumper=..., *, canonical: bool | None = None, @@ -156,8 +157,8 @@ def serialize( @overload def dump_all( - documents: Iterable[Any], - stream: _WriteStream[Any], + documents: Iterable[_YAMLObject], + stream: _WriteStream[_YAMLObject], Dumper=..., *, default_style: str | None = None, @@ -176,7 +177,7 @@ def dump_all( ) -> None: ... @overload def dump_all( - documents: Iterable[Any], + documents: Iterable[_YAMLObject], stream: None = None, Dumper=..., *, @@ -196,7 +197,7 @@ def dump_all( ) -> str: ... @overload def dump_all( - documents: Iterable[Any], + documents: Iterable[_YAMLObject], stream: None = None, Dumper=..., *, @@ -217,8 +218,8 @@ def dump_all( @overload def dump( - data: Any, - stream: _WriteStream[Any], + data: _YAMLObject, + stream: _WriteStream[_YAMLObject], Dumper=..., *, default_style: str | None = None, @@ -237,7 +238,7 @@ def dump( ) -> None: ... @overload def dump( - data: Any, + data: _YAMLObject, stream: None = None, Dumper=..., *, @@ -257,7 +258,7 @@ def dump( ) -> str: ... @overload def dump( - data: Any, + data: _YAMLObject, stream: None = None, Dumper=..., *, @@ -278,8 +279,8 @@ def dump( @overload def safe_dump_all( - documents: Iterable[Any], - stream: _WriteStream[Any], + documents: Iterable[_YAMLObject], + stream: _WriteStream[_YAMLObject], *, default_style: str | None = None, default_flow_style: bool | None = False, @@ -297,7 +298,7 @@ def safe_dump_all( ) -> None: ... @overload def safe_dump_all( - documents: Iterable[Any], + documents: Iterable[_YAMLObject], stream: None = None, *, default_style: str | None = None, @@ -316,7 +317,7 @@ def safe_dump_all( ) -> str: ... @overload def safe_dump_all( - documents: Iterable[Any], + documents: Iterable[_YAMLObject], stream: None = None, *, default_style: str | None = None, @@ -336,8 +337,8 @@ def safe_dump_all( @overload def safe_dump( - data: Any, - stream: _WriteStream[Any], + data: _YAMLObject, + stream: _WriteStream[_YAMLObject], *, default_style: str | None = None, default_flow_style: bool | None = False, @@ -355,7 +356,7 @@ def safe_dump( ) -> None: ... @overload def safe_dump( - data: Any, + data: _YAMLObject, stream: None = None, *, default_style: str | None = None, @@ -374,7 +375,7 @@ def safe_dump( ) -> str: ... @overload def safe_dump( - data: Any, + data: _YAMLObject, stream: None = None, *, default_style: str | None = None, @@ -395,32 +396,32 @@ def safe_dump( def add_implicit_resolver( tag: str, regexp: Pattern[str], - first: Iterable[Any] | None = None, + first: Iterable[Incomplete] | None = None, Loader: type[BaseResolver] | None = None, Dumper: type[BaseResolver] = ..., ) -> None: ... def add_path_resolver( tag: str, - path: Iterable[Any], - kind: type[Any] | None = None, + path: Iterable[Incomplete], + kind: type | None = None, Loader: type[BaseResolver] | None = None, Dumper: type[BaseResolver] = ..., ) -> None: ... @overload def add_constructor( - tag: str, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Any], Loader: None = None + tag: str, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Incomplete], Loader: None = None ) -> None: ... @overload -def add_constructor(tag: str, constructor: Callable[[_Constructor, Node], Any], Loader: type[_Constructor]) -> None: ... +def add_constructor(tag: str, constructor: Callable[[_Constructor, Node], Incomplete], Loader: type[_Constructor]) -> None: ... @overload def add_multi_constructor( - tag_prefix: str, multi_constructor: Callable[[Loader | FullLoader | UnsafeLoader, str, Node], Any], Loader: None = None + tag_prefix: str, multi_constructor: Callable[[Loader | FullLoader | UnsafeLoader, str, Node], Incomplete], Loader: None = None ) -> None: ... @overload def add_multi_constructor( - tag_prefix: str, multi_constructor: Callable[[_Constructor, str, Node], Any], Loader: type[_Constructor] + tag_prefix: str, multi_constructor: Callable[[_Constructor, str, Node], Incomplete], Loader: type[_Constructor] ) -> None: ... @overload @@ -440,10 +441,10 @@ class YAMLObjectMetaclass(type): class YAMLObject(metaclass=YAMLObjectMetaclass): __slots__ = () - yaml_loader: Any - yaml_dumper: Any - yaml_tag: Any - yaml_flow_style: Any + yaml_loader: Incomplete + yaml_dumper: Incomplete + yaml_tag: Incomplete + yaml_flow_style: Incomplete @classmethod def from_yaml(cls, loader, node): ... @classmethod diff --git a/stubs/PyYAML/yaml/_yaml.pyi b/stubs/PyYAML/yaml/_yaml.pyi index f7412770b57a..f1cb87c31770 100644 --- a/stubs/PyYAML/yaml/_yaml.pyi +++ b/stubs/PyYAML/yaml/_yaml.pyi @@ -12,12 +12,12 @@ def get_version() -> tuple[int, int, int]: ... @disjoint_base class Mark: - name: Any + name: Incomplete index: int line: int column: int - buffer: Any - pointer: Any + buffer: Incomplete + pointer: Incomplete def __init__(self, name, index: int, line: int, column: int, buffer, pointer) -> None: ... def get_snippet(self): ... @@ -42,14 +42,14 @@ class CEmitter: def __init__( self, stream: IO[Any], - canonical: Incomplete | None = ..., + canonical=..., indent: int | None = ..., width: int | None = ..., - allow_unicode: Incomplete | None = ..., + allow_unicode=..., line_break: str | None = ..., encoding: str | None = ..., - explicit_start: Incomplete | None = ..., - explicit_end: Incomplete | None = ..., + explicit_start=..., + explicit_end=..., version: Sequence[int] | None = ..., tags: Mapping[str, str] | None = ..., ) -> None: ... diff --git a/stubs/PyYAML/yaml/composer.pyi b/stubs/PyYAML/yaml/composer.pyi index 4c80c5bd3da8..d353d02220f9 100644 --- a/stubs/PyYAML/yaml/composer.pyi +++ b/stubs/PyYAML/yaml/composer.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from yaml.error import MarkedYAMLError from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode @@ -6,15 +6,15 @@ from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode class ComposerError(MarkedYAMLError): ... class Composer: - anchors: dict[Any, Node] + anchors: dict[Incomplete, Node] def __init__(self) -> None: ... def check_node(self) -> bool: ... def get_node(self) -> Node | None: ... def get_single_node(self) -> Node | None: ... def compose_document(self) -> Node | None: ... def compose_node(self, parent: Node | None, index: int) -> Node | None: ... - def compose_scalar_node(self, anchor: dict[Any, Node]) -> ScalarNode: ... - def compose_sequence_node(self, anchor: dict[Any, Node]) -> SequenceNode: ... - def compose_mapping_node(self, anchor: dict[Any, Node]) -> MappingNode: ... + def compose_scalar_node(self, anchor: dict[Incomplete, Node]) -> ScalarNode: ... + def compose_sequence_node(self, anchor: dict[Incomplete, Node]) -> SequenceNode: ... + def compose_mapping_node(self, anchor: dict[Incomplete, Node]) -> MappingNode: ... __all__ = ["Composer", "ComposerError"] diff --git a/stubs/PyYAML/yaml/constructor.pyi b/stubs/PyYAML/yaml/constructor.pyi index cfbe7828b019..4c5186840ddd 100644 --- a/stubs/PyYAML/yaml/constructor.pyi +++ b/stubs/PyYAML/yaml/constructor.pyi @@ -1,12 +1,16 @@ -from collections.abc import Callable, Hashable +from _typeshed import Incomplete +from collections.abc import Callable, Generator, Hashable from datetime import date from re import Pattern -from typing import Any, ClassVar, TypeVar +from types import GeneratorType, ModuleType +from typing import ClassVar, TypeVar +from typing_extensions import Never from yaml.error import MarkedYAMLError from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode from .cyaml import _CLoader +from .emitter import _YAMLObject from .loader import _Loader _L = TypeVar("_L", bound=_Loader | _CLoader) @@ -15,33 +19,33 @@ _N = TypeVar("_N", bound=Node) class ConstructorError(MarkedYAMLError): ... class BaseConstructor: - yaml_constructors: Any - yaml_multi_constructors: Any - constructed_objects: Any - recursive_objects: Any - state_generators: Any - deep_construct: Any + yaml_constructors: ClassVar[dict[str | None, Incomplete]] + yaml_multi_constructors: ClassVar[dict[str | None, Incomplete]] + constructed_objects: dict[Incomplete, Incomplete] + recursive_objects: dict[Incomplete, Incomplete] + state_generators: list[GeneratorType[Incomplete, Incomplete, Incomplete]] + deep_construct: bool def __init__(self) -> None: ... def check_data(self): ... def check_state_key(self, key: str) -> None: ... - def get_data(self): ... - def get_single_data(self) -> Any: ... - def construct_document(self, node): ... - def construct_object(self, node, deep: bool = False): ... + def get_data(self) -> _YAMLObject: ... + def get_single_data(self) -> _YAMLObject: ... + def construct_document(self, node) -> _YAMLObject: ... + def construct_object(self, node, deep: bool = False) -> _YAMLObject: ... def construct_scalar(self, node: ScalarNode) -> str: ... - def construct_sequence(self, node: SequenceNode, deep: bool = False) -> list[Any]: ... - def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Any]: ... - def construct_pairs(self, node, deep: bool = False): ... + def construct_sequence(self, node: SequenceNode, deep: bool = False) -> list[Incomplete]: ... + def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Incomplete]: ... + def construct_pairs(self, node, deep: bool = False) -> list[tuple[Incomplete, Incomplete]]: ... @classmethod # Use typevars so we can have covariant behaviour in the parameter types - def add_constructor(cls, tag: str, constructor: Callable[[_L, _N], Any]) -> None: ... + def add_constructor(cls, tag: str, constructor: Callable[[_L, _N], Incomplete]) -> None: ... @classmethod - def add_multi_constructor(cls, tag_prefix, multi_constructor): ... + def add_multi_constructor(cls, tag_prefix: str | None, multi_constructor) -> None: ... class SafeConstructor(BaseConstructor): def construct_scalar(self, node: ScalarNode | MappingNode) -> str: ... def flatten_mapping(self, node: MappingNode) -> None: ... - def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Any]: ... + def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Incomplete]: ... def construct_yaml_null(self, node: ScalarNode) -> None: ... bool_values: ClassVar[dict[str, bool]] def construct_yaml_bool(self, node: ScalarNode) -> bool: ... @@ -52,54 +56,40 @@ class SafeConstructor(BaseConstructor): def construct_yaml_binary(self, node: ScalarNode) -> bytes: ... timestamp_regexp: ClassVar[Pattern[str]] def construct_yaml_timestamp(self, node: ScalarNode) -> date: ... - def construct_yaml_omap(self, node): ... - def construct_yaml_pairs(self, node): ... - def construct_yaml_set(self, node): ... - def construct_yaml_str(self, node): ... - def construct_yaml_seq(self, node): ... - def construct_yaml_map(self, node): ... - def construct_yaml_object(self, node, cls): ... - def construct_undefined(self, node): ... + def construct_yaml_omap(self, node) -> Generator[list[tuple[Incomplete, Incomplete]]]: ... + def construct_yaml_pairs(self, node) -> Generator[list[tuple[Incomplete, Incomplete]]]: ... + def construct_yaml_set(self, node) -> Generator[set[dict[Hashable, Incomplete]]]: ... + def construct_yaml_str(self, node) -> str: ... + def construct_yaml_seq(self, node) -> Generator[list[Incomplete]]: ... + def construct_yaml_map(self, node) -> Generator[dict[Incomplete, Incomplete]]: ... + def construct_yaml_object(self, node, cls) -> Generator[Incomplete]: ... + def construct_undefined(self, node) -> Never: ... class FullConstructor(SafeConstructor): def get_state_keys_blacklist(self) -> list[str]: ... def get_state_keys_blacklist_regexp(self) -> Pattern[str]: ... - 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: str, mark, unsafe: bool = False): ... + def construct_python_str(self, node) -> str: ... + def construct_python_unicode(self, node) -> str: ... + def construct_python_bytes(self, node) -> bytes: ... + def construct_python_long(self, node) -> int: ... + def construct_python_complex(self, node) -> complex: ... + def construct_python_tuple(self, node) -> tuple[Incomplete, ...]: ... + def find_python_module(self, name: str, mark, unsafe: bool = False) -> ModuleType: ... def find_python_name(self, name: str, mark, unsafe: bool = False): ... - def construct_python_name(self, suffix, node): ... - def construct_python_module(self, suffix, node): ... - def make_python_instance(self, suffix, node, args=None, kwds=None, newobj: bool = False, unsafe: bool = False): ... - def set_python_instance_state(self, instance: Any, state, unsafe: bool = False) -> None: ... - def construct_python_object(self, suffix, node): ... - def construct_python_object_apply(self, suffix, node, newobj=False): ... - def construct_python_object_new(self, suffix, node): ... + def construct_python_name(self, suffix: str, node): ... + def construct_python_module(self, suffix: str, node) -> ModuleType: ... + def make_python_instance(self, suffix: str, node, args=None, kwds=None, newobj: bool = False, unsafe: bool = False): ... + def set_python_instance_state(self, instance: object, state, unsafe: bool = False) -> None: ... + def construct_python_object(self, suffix: str, node) -> Generator[Incomplete]: ... + def construct_python_object_apply(self, suffix: str, node, newobj: bool = False): ... + def construct_python_object_new(self, suffix: str, node): ... class UnsafeConstructor(FullConstructor): - def find_python_module(self, name: str, mark): ... # type: ignore[override] + def find_python_module(self, name: str, mark) -> ModuleType: ... # type: ignore[override] def find_python_name(self, name: str, mark): ... # type: ignore[override] def make_python_instance(self, suffix: str, node, args=None, kwds=None, newobj: bool = False): ... # type: ignore[override] - def set_python_instance_state(self, instance: Any, state): ... # type: ignore[override] + def set_python_instance_state(self, instance: object, state) -> None: ... # type: ignore[override] -class Constructor(SafeConstructor): - def construct_python_str(self, node): ... - def construct_python_unicode(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): ... - def find_python_name(self, name, mark): ... - def construct_python_name(self, suffix, node): ... - def construct_python_module(self, suffix, node): ... - def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): ... - def set_python_instance_state(self, instance, state): ... - def construct_python_object(self, suffix, node): ... - def construct_python_object_apply(self, suffix, node, newobj=False): ... - def construct_python_object_new(self, suffix, node): ... +class Constructor(SafeConstructor): ... __all__ = ["BaseConstructor", "SafeConstructor", "FullConstructor", "UnsafeConstructor", "Constructor", "ConstructorError"] diff --git a/stubs/PyYAML/yaml/dumper.pyi b/stubs/PyYAML/yaml/dumper.pyi index e7b18733101d..a414124d233e 100644 --- a/stubs/PyYAML/yaml/dumper.pyi +++ b/stubs/PyYAML/yaml/dumper.pyi @@ -1,12 +1,12 @@ from collections.abc import Mapping -from typing import Any, TypeAlias +from typing import TypeAlias from yaml.emitter import Emitter from yaml.representer import BaseRepresenter, Representer, SafeRepresenter from yaml.resolver import BaseResolver, Resolver from yaml.serializer import Serializer -from .emitter import _WriteStream +from .emitter import _WriteStream, _YAMLObject # Ideally, there would be a way to limit these values to only +/- float("inf"), # but that's not possible at the moment (https://github.com/python/typing/issues/1160). @@ -15,7 +15,7 @@ _Inf: TypeAlias = float class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__( self, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], default_style: str | None = None, default_flow_style: bool | None = False, canonical: bool | None = None, @@ -34,7 +34,7 @@ class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): def __init__( self, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], default_style: str | None = None, default_flow_style: bool | None = False, canonical: bool | None = None, @@ -53,7 +53,7 @@ class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): class Dumper(Emitter, Serializer, Representer, Resolver): def __init__( self, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], default_style: str | None = None, default_flow_style: bool | None = False, canonical: bool | None = None, diff --git a/stubs/PyYAML/yaml/emitter.pyi b/stubs/PyYAML/yaml/emitter.pyi index 3a19e94a31a9..80388523f320 100644 --- a/stubs/PyYAML/yaml/emitter.pyi +++ b/stubs/PyYAML/yaml/emitter.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from collections.abc import Callable -from typing import Any, Protocol, TypeVar, type_check_only +from typing import Any, Final, Protocol, TypeAlias, TypeVar, type_check_only from typing_extensions import Never from yaml.error import YAMLError @@ -7,6 +8,7 @@ from yaml.error import YAMLError from .events import Event _T_contra = TypeVar("_T_contra", str, bytes, contravariant=True) +_YAMLObject: TypeAlias = Any @type_check_only class _WriteStream(Protocol[_T_contra]): @@ -18,21 +20,21 @@ class _WriteStream(Protocol[_T_contra]): class EmitterError(YAMLError): ... class ScalarAnalysis: - scalar: Any - empty: Any - multiline: Any - allow_flow_plain: Any - allow_block_plain: Any - allow_single_quoted: Any - allow_double_quoted: Any - allow_block: Any + scalar: Incomplete + empty: Incomplete + multiline: Incomplete + allow_flow_plain: Incomplete + allow_block_plain: Incomplete + allow_single_quoted: Incomplete + allow_double_quoted: Incomplete + allow_block: Incomplete def __init__( self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block ) -> None: ... class Emitter: - DEFAULT_TAG_PREFIXES: dict[str, str] - stream: _WriteStream[Any] + DEFAULT_TAG_PREFIXES: Final[dict[str, str]] + stream: _WriteStream[_YAMLObject] encoding: str | None states: list[Callable[[], None]] state: Callable[[], None] | None @@ -62,7 +64,7 @@ class Emitter: style: str | None def __init__( self, - stream: _WriteStream[Any], + stream: _WriteStream[_YAMLObject], canonical: bool | None = None, indent: int | None = None, width: int | None = None, @@ -126,7 +128,7 @@ class Emitter: def write_version_directive(self, version_text: str) -> None: ... def write_tag_directive(self, handle_text: str, prefix_text: str) -> None: ... def write_single_quoted(self, text: str, split: bool = True) -> None: ... - ESCAPE_REPLACEMENTS: dict[str, str] + ESCAPE_REPLACEMENTS: Final[dict[str, str]] def write_double_quoted(self, text: str, split: bool = True) -> None: ... def determine_block_hints(self, text: str) -> str: ... def write_folded(self, text: str) -> None: ... diff --git a/stubs/PyYAML/yaml/events.pyi b/stubs/PyYAML/yaml/events.pyi index e4e2a8f1ce8b..3c0e3e30036e 100644 --- a/stubs/PyYAML/yaml/events.pyi +++ b/stubs/PyYAML/yaml/events.pyi @@ -1,59 +1,59 @@ -from typing import Any +from _typeshed import Incomplete class Event: - start_mark: Any - end_mark: Any + start_mark: Incomplete + end_mark: Incomplete def __init__(self, start_mark=None, end_mark=None) -> None: ... class NodeEvent(Event): - anchor: Any - start_mark: Any - end_mark: Any + anchor: Incomplete + start_mark: Incomplete + end_mark: Incomplete def __init__(self, anchor, start_mark=None, end_mark=None) -> None: ... class CollectionStartEvent(NodeEvent): - anchor: Any - tag: Any - implicit: Any - start_mark: Any - end_mark: Any - flow_style: Any + anchor: Incomplete + tag: Incomplete + implicit: Incomplete + start_mark: Incomplete + end_mark: Incomplete + flow_style: Incomplete def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None, flow_style=None) -> None: ... class CollectionEndEvent(Event): ... class StreamStartEvent(Event): - start_mark: Any - end_mark: Any - encoding: Any + start_mark: Incomplete + end_mark: Incomplete + encoding: Incomplete def __init__(self, start_mark=None, end_mark=None, encoding=None) -> None: ... class StreamEndEvent(Event): ... class DocumentStartEvent(Event): - start_mark: Any - end_mark: Any - explicit: Any - version: Any - tags: Any + start_mark: Incomplete + end_mark: Incomplete + explicit: Incomplete + version: Incomplete + tags: Incomplete def __init__(self, start_mark=None, end_mark=None, explicit=None, version=None, tags=None) -> None: ... class DocumentEndEvent(Event): - start_mark: Any - end_mark: Any - explicit: Any + start_mark: Incomplete + end_mark: Incomplete + explicit: Incomplete def __init__(self, start_mark=None, end_mark=None, explicit=None) -> None: ... class AliasEvent(NodeEvent): ... class ScalarEvent(NodeEvent): - anchor: Any - tag: Any - implicit: Any - value: Any - start_mark: Any - end_mark: Any - style: Any + anchor: Incomplete + tag: Incomplete + implicit: Incomplete + value: Incomplete + start_mark: Incomplete + end_mark: Incomplete + style: Incomplete def __init__(self, anchor, tag, implicit, value, start_mark=None, end_mark=None, style=None) -> None: ... class SequenceStartEvent(CollectionStartEvent): ... diff --git a/stubs/PyYAML/yaml/nodes.pyi b/stubs/PyYAML/yaml/nodes.pyi index de490db93d1a..d97634fd5fa3 100644 --- a/stubs/PyYAML/yaml/nodes.pyi +++ b/stubs/PyYAML/yaml/nodes.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from yaml.error import Mark @@ -7,7 +8,7 @@ from yaml.error import Mark # Permissive Unions could also be useful here. class Node: tag: str - value: Any + value: Incomplete start_mark: Mark | Any end_mark: Mark | Any def __init__(self, tag: str, value, start_mark: Mark | None, end_mark: Mark | None) -> None: ... diff --git a/stubs/PyYAML/yaml/parser.pyi b/stubs/PyYAML/yaml/parser.pyi index b2c7b42db3ce..4949665f8153 100644 --- a/stubs/PyYAML/yaml/parser.pyi +++ b/stubs/PyYAML/yaml/parser.pyi @@ -1,32 +1,35 @@ -from typing import Any +from _typeshed import Incomplete +from builtins import _ClassInfo +from typing import Final from yaml.error import MarkedYAMLError +from yaml.events import DocumentEndEvent, MappingEndEvent, ScalarEvent, StreamStartEvent class ParserError(MarkedYAMLError): ... class Parser: - DEFAULT_TAGS: Any - current_event: Any - yaml_version: Any - tag_handles: Any - states: Any - marks: Any - state: Any + DEFAULT_TAGS: Final[dict[str, str]] + current_event: Incomplete + yaml_version: Incomplete + tag_handles: dict[str, str] + states: list[Incomplete] + marks: list[Incomplete] + state: Incomplete def __init__(self) -> None: ... - def dispose(self): ... - def check_event(self, *choices): ... + def dispose(self) -> None: ... + def check_event(self, *choices: _ClassInfo) -> bool: ... def peek_event(self): ... def get_event(self): ... - def parse_stream_start(self): ... + def parse_stream_start(self) -> StreamStartEvent: ... def parse_implicit_document_start(self): ... def parse_document_start(self): ... - def parse_document_end(self): ... + def parse_document_end(self) -> DocumentEndEvent: ... def parse_document_content(self): ... def process_directives(self): ... def parse_block_node(self): ... def parse_flow_node(self): ... def parse_block_node_or_indentless_sequence(self): ... - def parse_node(self, block=False, indentless_sequence=False): ... + def parse_node(self, block: bool = False, indentless_sequence: bool = False): ... def parse_block_sequence_first_entry(self): ... def parse_block_sequence_entry(self): ... def parse_indentless_sequence_entry(self): ... @@ -34,14 +37,14 @@ class Parser: def parse_block_mapping_key(self): ... def parse_block_mapping_value(self): ... def parse_flow_sequence_first_entry(self): ... - def parse_flow_sequence_entry(self, first=False): ... + def parse_flow_sequence_entry(self, first: bool = False): ... def parse_flow_sequence_entry_mapping_key(self): ... def parse_flow_sequence_entry_mapping_value(self): ... - def parse_flow_sequence_entry_mapping_end(self): ... + def parse_flow_sequence_entry_mapping_end(self) -> MappingEndEvent: ... def parse_flow_mapping_first_key(self): ... - def parse_flow_mapping_key(self, first=False): ... + def parse_flow_mapping_key(self, first: bool = False): ... def parse_flow_mapping_value(self): ... - def parse_flow_mapping_empty_value(self): ... - def process_empty_scalar(self, mark): ... + def parse_flow_mapping_empty_value(self) -> ScalarEvent: ... + def process_empty_scalar(self, mark) -> ScalarEvent: ... __all__ = ["Parser", "ParserError"] diff --git a/stubs/PyYAML/yaml/reader.pyi b/stubs/PyYAML/yaml/reader.pyi index 84a0e36e2bee..cb01d3ca7c8b 100644 --- a/stubs/PyYAML/yaml/reader.pyi +++ b/stubs/PyYAML/yaml/reader.pyi @@ -1,40 +1,41 @@ -from _typeshed import SupportsRead -from typing import Any, TypeAlias +from _typeshed import Incomplete, SupportsRead +from re import Pattern +from typing import Final, TypeAlias -from yaml.error import YAMLError +from yaml.error import Mark, YAMLError _ReadStream: TypeAlias = str | bytes | SupportsRead[str] | SupportsRead[bytes] class ReaderError(YAMLError): - name: Any - character: Any - position: Any - encoding: Any - reason: Any + name: Incomplete + character: Incomplete + position: Incomplete + encoding: Incomplete + reason: Incomplete def __init__(self, name, position, character, encoding, reason) -> None: ... class Reader: - name: Any + name: Incomplete stream: SupportsRead[str] | SupportsRead[bytes] | None - stream_pointer: Any - eof: Any - buffer: Any - pointer: Any - raw_buffer: Any - raw_decode: Any - encoding: Any - index: Any - line: Any - column: Any + stream_pointer: Incomplete + eof: Incomplete + buffer: Incomplete + pointer: Incomplete + raw_buffer: Incomplete + raw_decode: Incomplete + encoding: Incomplete + index: Incomplete + line: Incomplete + column: Incomplete def __init__(self, stream: _ReadStream) -> None: ... - def peek(self, index=0): ... - def prefix(self, length=1): ... - def forward(self, length=1): ... - def get_mark(self): ... - def determine_encoding(self): ... - NON_PRINTABLE: Any - def check_printable(self, data): ... - def update(self, length): ... - def update_raw(self, size=4096): ... + def peek(self, index: int = 0): ... + def prefix(self, length: int = 1): ... + def forward(self, length: int = 1) -> None: ... + def get_mark(self) -> Mark: ... + def determine_encoding(self) -> None: ... + NON_PRINTABLE: Final[Pattern[str]] + def check_printable(self, data: str) -> None: ... + def update(self, length: int) -> None: ... + def update_raw(self, size: int = 4096) -> None: ... __all__ = ["Reader", "ReaderError"] diff --git a/stubs/PyYAML/yaml/representer.pyi b/stubs/PyYAML/yaml/representer.pyi index ac10d892949b..38255a636d49 100644 --- a/stubs/PyYAML/yaml/representer.pyi +++ b/stubs/PyYAML/yaml/representer.pyi @@ -2,7 +2,7 @@ import datetime from _typeshed import Incomplete, ReadableBuffer, SupportsItems from collections.abc import Callable, Iterable, Mapping from types import BuiltinFunctionType, FunctionType, ModuleType -from typing import Any, ClassVar, TypeVar +from typing import ClassVar, TypeVar from typing_extensions import Never, Self from yaml.error import YAMLError as YAMLError @@ -13,13 +13,13 @@ _T = TypeVar("_T") class RepresenterError(YAMLError): ... class BaseRepresenter: - yaml_representers: ClassVar[dict[type[Any], Callable[[BaseRepresenter, Any], Node]]] - yaml_multi_representers: ClassVar[dict[type[Any], Callable[[BaseRepresenter, Any], Node]]] + yaml_representers: ClassVar[dict[type[Incomplete], Callable[[BaseRepresenter, Incomplete], Node]]] + yaml_multi_representers: ClassVar[dict[type[Incomplete], Callable[[BaseRepresenter, Incomplete], Node]]] default_style: str | Incomplete sort_keys: bool default_flow_style: bool represented_objects: dict[int, Node] - object_keeper: list[Any] + object_keeper: list[Incomplete] alias_key: int | Incomplete def __init__(self, default_style: str | None = None, default_flow_style: bool = False, sort_keys: bool = True) -> None: ... def represent(self, data) -> None: ... @@ -29,9 +29,12 @@ class BaseRepresenter: @classmethod def add_multi_representer(cls, data_type: type[_T], representer: Callable[[Self, _T], Node]) -> None: ... def represent_scalar(self, tag: str, value, style: str | None = None) -> ScalarNode: ... - def represent_sequence(self, tag: str, sequence: Iterable[Any], flow_style: bool | None = None) -> SequenceNode: ... + def represent_sequence(self, tag: str, sequence: Iterable[Incomplete], flow_style: bool | None = None) -> SequenceNode: ... def represent_mapping( - self, tag: str, mapping: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]], flow_style: bool | None = None + self, + tag: str, + mapping: SupportsItems[Incomplete, Incomplete] | Iterable[tuple[Incomplete, Incomplete]], + flow_style: bool | None = None, ) -> MappingNode: ... def ignore_aliases(self, data) -> bool: ... @@ -44,9 +47,11 @@ class SafeRepresenter(BaseRepresenter): def represent_bool(self, data: bool) -> ScalarNode: ... def represent_int(self, data: int) -> ScalarNode: ... def represent_float(self, data: float) -> ScalarNode: ... - def represent_list(self, data: Iterable[Any]) -> SequenceNode: ... - def represent_dict(self, data: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]]) -> MappingNode: ... - def represent_set(self, data: Iterable[Any]) -> MappingNode: ... + def represent_list(self, data: Iterable[Incomplete]) -> SequenceNode: ... + def represent_dict( + self, data: SupportsItems[Incomplete, Incomplete] | Iterable[tuple[Incomplete, Incomplete]] + ) -> MappingNode: ... + def represent_set(self, data: Iterable[Incomplete]) -> MappingNode: ... def represent_date(self, data: datetime.date) -> ScalarNode: ... def represent_datetime(self, data: datetime.datetime) -> ScalarNode: ... def represent_yaml_object(self, tag: str, data, cls, flow_style: bool | None = None) -> MappingNode: ... @@ -54,10 +59,10 @@ class SafeRepresenter(BaseRepresenter): class Representer(SafeRepresenter): def represent_complex(self, data: complex) -> ScalarNode: ... - def represent_tuple(self, data: Iterable[Any]) -> SequenceNode: ... + def represent_tuple(self, data: Iterable[Incomplete]) -> SequenceNode: ... def represent_name(self, data: BuiltinFunctionType | FunctionType) -> ScalarNode: ... def represent_module(self, data: ModuleType) -> ScalarNode: ... def represent_object(self, data) -> SequenceNode | MappingNode: ... - def represent_ordered_dict(self, data: Mapping[Any, Any]) -> SequenceNode: ... + def represent_ordered_dict(self, data: Mapping[Incomplete, Incomplete]) -> SequenceNode: ... __all__ = ["BaseRepresenter", "SafeRepresenter", "Representer", "RepresenterError"] diff --git a/stubs/PyYAML/yaml/resolver.pyi b/stubs/PyYAML/yaml/resolver.pyi index 614425ab4cbb..2df705d34825 100644 --- a/stubs/PyYAML/yaml/resolver.pyi +++ b/stubs/PyYAML/yaml/resolver.pyi @@ -1,24 +1,25 @@ -from typing import Any +from _typeshed import Incomplete +from typing import Final from yaml.error import YAMLError class ResolverError(YAMLError): ... class BaseResolver: - DEFAULT_SCALAR_TAG: Any - DEFAULT_SEQUENCE_TAG: Any - DEFAULT_MAPPING_TAG: Any - yaml_implicit_resolvers: Any - yaml_path_resolvers: Any - resolver_exact_paths: Any - resolver_prefix_paths: Any + DEFAULT_SCALAR_TAG: Final = "tag:yaml.org,2002:str" + DEFAULT_SEQUENCE_TAG: Final = "tag:yaml.org,2002:seq" + DEFAULT_MAPPING_TAG: Final = "tag:yaml.org,2002:map" + yaml_implicit_resolvers: dict[Incomplete, Incomplete] + yaml_path_resolvers: dict[Incomplete, Incomplete] + resolver_exact_paths: list[Incomplete] + resolver_prefix_paths: list[Incomplete] def __init__(self) -> None: ... @classmethod - def add_implicit_resolver(cls, tag, regexp, first): ... + def add_implicit_resolver(cls, tag, regexp, first) -> None: ... @classmethod - def add_path_resolver(cls, tag, path, kind=None): ... - def descend_resolver(self, current_node, current_index): ... - def ascend_resolver(self): ... + def add_path_resolver(cls, tag, path, kind=None) -> None: ... + def descend_resolver(self, current_node, current_index) -> None: ... + def ascend_resolver(self) -> None: ... def check_resolver_prefix(self, depth, path, kind, current_node, current_index): ... def resolve(self, kind, value, implicit): ... diff --git a/stubs/PyYAML/yaml/scanner.pyi b/stubs/PyYAML/yaml/scanner.pyi index 0feaf8caa88b..64c1dfe486c1 100644 --- a/stubs/PyYAML/yaml/scanner.pyi +++ b/stubs/PyYAML/yaml/scanner.pyi @@ -1,99 +1,102 @@ -from typing import Any +from _typeshed import Incomplete +from builtins import _ClassInfo +from typing import Final from yaml.error import MarkedYAMLError +from yaml.tokens import DirectiveToken, ScalarToken, TagToken class ScannerError(MarkedYAMLError): ... class SimpleKey: - token_number: Any - required: Any - index: Any - line: Any - column: Any - mark: Any - def __init__(self, token_number, required, index, line, column, mark) -> None: ... + token_number: Incomplete + required: bool + index: Incomplete + line: Incomplete + column: Incomplete + mark: Incomplete + def __init__(self, token_number, required: bool, index, line, column, mark) -> None: ... class Scanner: - done: Any - flow_level: Any - tokens: Any - tokens_taken: Any - indent: Any - indents: Any - allow_simple_key: Any - possible_simple_keys: Any + done: bool + flow_level: int + tokens: list[Incomplete] + tokens_taken: int + indent: int + indents: list[int] + allow_simple_key: bool + possible_simple_keys: dict[int, SimpleKey] def __init__(self) -> None: ... - def check_token(self, *choices): ... + def check_token(self, *choices: _ClassInfo) -> bool: ... def peek_token(self): ... def get_token(self): ... - def need_more_tokens(self): ... - def fetch_more_tokens(self): ... + def need_more_tokens(self) -> bool | None: ... + def fetch_more_tokens(self) -> None: ... def next_possible_simple_key(self): ... - def stale_possible_simple_keys(self): ... - def save_possible_simple_key(self): ... - def remove_possible_simple_key(self): ... - def unwind_indent(self, column): ... - def add_indent(self, column): ... - def fetch_stream_start(self): ... - def fetch_stream_end(self): ... - def fetch_directive(self): ... - def fetch_document_start(self): ... - def fetch_document_end(self): ... - def fetch_document_indicator(self, TokenClass): ... - def fetch_flow_sequence_start(self): ... - def fetch_flow_mapping_start(self): ... - def fetch_flow_collection_start(self, TokenClass): ... - def fetch_flow_sequence_end(self): ... - def fetch_flow_mapping_end(self): ... - def fetch_flow_collection_end(self, TokenClass): ... - def fetch_flow_entry(self): ... - def fetch_block_entry(self): ... - def fetch_key(self): ... - def fetch_value(self): ... - def fetch_alias(self): ... - def fetch_anchor(self): ... - def fetch_tag(self): ... - def fetch_literal(self): ... - def fetch_folded(self): ... - def fetch_block_scalar(self, style): ... - def fetch_single(self): ... - def fetch_double(self): ... - def fetch_flow_scalar(self, style): ... - def fetch_plain(self): ... + def stale_possible_simple_keys(self) -> None: ... + def save_possible_simple_key(self) -> None: ... + def remove_possible_simple_key(self) -> None: ... + def unwind_indent(self, column) -> None: ... + def add_indent(self, column) -> bool: ... + def fetch_stream_start(self) -> None: ... + def fetch_stream_end(self) -> None: ... + def fetch_directive(self) -> None: ... + def fetch_document_start(self) -> None: ... + def fetch_document_end(self) -> None: ... + def fetch_document_indicator(self, TokenClass) -> None: ... + def fetch_flow_sequence_start(self) -> None: ... + def fetch_flow_mapping_start(self) -> None: ... + def fetch_flow_collection_start(self, TokenClass) -> None: ... + def fetch_flow_sequence_end(self) -> None: ... + def fetch_flow_mapping_end(self) -> None: ... + def fetch_flow_collection_end(self, TokenClass) -> None: ... + def fetch_flow_entry(self) -> None: ... + def fetch_block_entry(self) -> None: ... + def fetch_key(self) -> None: ... + def fetch_value(self) -> None: ... + def fetch_alias(self) -> None: ... + def fetch_anchor(self) -> None: ... + def fetch_tag(self) -> None: ... + def fetch_literal(self) -> None: ... + def fetch_folded(self) -> None: ... + def fetch_block_scalar(self, style) -> None: ... + def fetch_single(self) -> None: ... + def fetch_double(self) -> None: ... + def fetch_flow_scalar(self, style) -> None: ... + def fetch_plain(self) -> None: ... def check_directive(self): ... def check_document_start(self): ... def check_document_end(self): ... - def check_block_entry(self): ... - def check_key(self): ... - def check_value(self): ... - def check_plain(self): ... - def scan_to_next_token(self): ... - def scan_directive(self): ... + def check_block_entry(self) -> bool: ... + def check_key(self) -> bool: ... + def check_value(self) -> bool: ... + def check_plain(self) -> bool: ... + def scan_to_next_token(self) -> None: ... + def scan_directive(self) -> DirectiveToken: ... def scan_directive_name(self, start_mark): ... - def scan_yaml_directive_value(self, start_mark): ... - def scan_yaml_directive_number(self, start_mark): ... - def scan_tag_directive_value(self, start_mark): ... + def scan_yaml_directive_value(self, start_mark) -> tuple[int, int]: ... + def scan_yaml_directive_number(self, start_mark) -> int: ... + def scan_tag_directive_value(self, start_mark) -> tuple[Incomplete, str]: ... def scan_tag_directive_handle(self, start_mark): ... - def scan_tag_directive_prefix(self, start_mark): ... - def scan_directive_ignored_line(self, start_mark): ... + def scan_tag_directive_prefix(self, start_mark) -> str: ... + def scan_directive_ignored_line(self, start_mark) -> None: ... def scan_anchor(self, TokenClass): ... - def scan_tag(self): ... - def scan_block_scalar(self, style): ... - def scan_block_scalar_indicators(self, start_mark): ... - def scan_block_scalar_ignored_line(self, start_mark): ... - def scan_block_scalar_indentation(self): ... - def scan_block_scalar_breaks(self, indent): ... - def scan_flow_scalar(self, style): ... - ESCAPE_REPLACEMENTS: Any - ESCAPE_CODES: Any - def scan_flow_scalar_non_spaces(self, double, start_mark): ... - def scan_flow_scalar_spaces(self, double, start_mark): ... - def scan_flow_scalar_breaks(self, double, start_mark): ... - def scan_plain(self): ... - def scan_plain_spaces(self, indent, start_mark): ... + def scan_tag(self) -> TagToken: ... + def scan_block_scalar(self, style) -> ScalarToken: ... + def scan_block_scalar_indicators(self, start_mark) -> tuple[bool | None, int | None]: ... + def scan_block_scalar_ignored_line(self, start_mark) -> None: ... + def scan_block_scalar_indentation(self) -> tuple[list[Incomplete], int, Incomplete]: ... + def scan_block_scalar_breaks(self, indent) -> tuple[list[Incomplete], Incomplete]: ... + def scan_flow_scalar(self, style) -> ScalarToken: ... + ESCAPE_REPLACEMENTS: Final[dict[str, str]] + ESCAPE_CODES: Final[dict[str, int]] + def scan_flow_scalar_non_spaces(self, double, start_mark) -> list[Incomplete]: ... + def scan_flow_scalar_spaces(self, double, start_mark) -> list[Incomplete]: ... + def scan_flow_scalar_breaks(self, double, start_mark) -> list[Incomplete]: ... + def scan_plain(self) -> ScalarToken: ... + def scan_plain_spaces(self, indent, start_mark) -> list[Incomplete] | None: ... def scan_tag_handle(self, name, start_mark): ... - def scan_tag_uri(self, name, start_mark): ... - def scan_uri_escapes(self, name, start_mark): ... + def scan_tag_uri(self, name, start_mark) -> str: ... + def scan_uri_escapes(self, name, start_mark) -> str: ... def scan_line_break(self): ... __all__ = ["Scanner", "ScannerError"] diff --git a/stubs/PyYAML/yaml/serializer.pyi b/stubs/PyYAML/yaml/serializer.pyi index ae1e98f796cf..16b4ebccda1a 100644 --- a/stubs/PyYAML/yaml/serializer.pyi +++ b/stubs/PyYAML/yaml/serializer.pyi @@ -1,4 +1,5 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar from yaml.error import YAMLError from yaml.nodes import Node @@ -6,22 +7,22 @@ from yaml.nodes import Node class SerializerError(YAMLError): ... class Serializer: - ANCHOR_TEMPLATE: Any - use_encoding: Any - use_explicit_start: Any - use_explicit_end: Any - use_version: Any - use_tags: Any - serialized_nodes: Any - anchors: Any - last_anchor_id: Any - closed: Any + ANCHOR_TEMPLATE: ClassVar[str] + use_encoding: Incomplete + use_explicit_start: Incomplete + use_explicit_end: Incomplete + use_version: Incomplete + use_tags: Incomplete + serialized_nodes: dict[Incomplete, Incomplete] + anchors: dict[Incomplete, Incomplete] + last_anchor_id: int + closed: bool | None def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None) -> None: ... def open(self) -> None: ... def close(self) -> None: ... def serialize(self, node: Node) -> None: ... - def anchor_node(self, node): ... - def generate_anchor(self, node): ... - def serialize_node(self, node, parent, index): ... + def anchor_node(self, node) -> None: ... + def generate_anchor(self, node) -> str: ... + def serialize_node(self, node, parent, index) -> None: ... __all__ = ["Serializer", "SerializerError"] diff --git a/stubs/PyYAML/yaml/tokens.pyi b/stubs/PyYAML/yaml/tokens.pyi index 632a1644ad79..1034b5791786 100644 --- a/stubs/PyYAML/yaml/tokens.pyi +++ b/stubs/PyYAML/yaml/tokens.pyi @@ -1,93 +1,94 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar class Token: - start_mark: Any - end_mark: Any + start_mark: Incomplete + end_mark: Incomplete def __init__(self, start_mark, end_mark) -> None: ... class DirectiveToken(Token): - id: Any - name: Any - value: Any - start_mark: Any - end_mark: Any + id: ClassVar[str] + name: Incomplete + value: Incomplete + start_mark: Incomplete + end_mark: Incomplete def __init__(self, name, value, start_mark, end_mark) -> None: ... class DocumentStartToken(Token): - id: Any + id: ClassVar[str] class DocumentEndToken(Token): - id: Any + id: ClassVar[str] class StreamStartToken(Token): - id: Any - start_mark: Any - end_mark: Any - encoding: Any + id: ClassVar[str] + start_mark: Incomplete + end_mark: Incomplete + encoding: Incomplete def __init__(self, start_mark=None, end_mark=None, encoding=None) -> None: ... class StreamEndToken(Token): - id: Any + id: ClassVar[str] class BlockSequenceStartToken(Token): - id: Any + id: ClassVar[str] class BlockMappingStartToken(Token): - id: Any + id: ClassVar[str] class BlockEndToken(Token): - id: Any + id: ClassVar[str] class FlowSequenceStartToken(Token): - id: Any + id: ClassVar[str] class FlowMappingStartToken(Token): - id: Any + id: ClassVar[str] class FlowSequenceEndToken(Token): - id: Any + id: ClassVar[str] class FlowMappingEndToken(Token): - id: Any + id: ClassVar[str] class KeyToken(Token): - id: Any + id: ClassVar[str] class ValueToken(Token): - id: Any + id: ClassVar[str] class BlockEntryToken(Token): - id: Any + id: ClassVar[str] class FlowEntryToken(Token): - id: Any + id: ClassVar[str] class AliasToken(Token): - id: Any - value: Any - start_mark: Any - end_mark: Any + id: ClassVar[str] + value: Incomplete + start_mark: Incomplete + end_mark: Incomplete def __init__(self, value, start_mark, end_mark) -> None: ... class AnchorToken(Token): - id: Any - value: Any - start_mark: Any - end_mark: Any + id: ClassVar[str] + value: Incomplete + start_mark: Incomplete + end_mark: Incomplete def __init__(self, value, start_mark, end_mark) -> None: ... class TagToken(Token): - id: Any - value: Any - start_mark: Any - end_mark: Any + id: ClassVar[str] + value: Incomplete + start_mark: Incomplete + end_mark: Incomplete def __init__(self, value, start_mark, end_mark) -> None: ... class ScalarToken(Token): - id: Any - value: Any - plain: Any - start_mark: Any - end_mark: Any - style: Any + id: ClassVar[str] + value: Incomplete + plain: Incomplete + start_mark: Incomplete + end_mark: Incomplete + style: Incomplete def __init__(self, value, plain, start_mark, end_mark, style=None) -> None: ...