Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenlele committed Sep 15, 2024
1 parent 6110387 commit 1f10574
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions stubs/ruamel.yaml/ruamel/yaml/main.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ from .nodes import Node
from .parser import Parser, RoundTripParser
from .reader import Reader
from .representer import BaseRepresenter, Representer, RoundTripRepresenter, _RepresenterFunction
from .resolver import BaseResolver, _First, _TagStr
from .resolver import BaseResolver
from .scanner import RoundTripScanner, Scanner
from .serializer import Serializer
from .tag import Tag, _TagHandleToPrefix
Expand Down Expand Up @@ -305,15 +305,15 @@ def safe_dump(*args, **kwargs) -> NoReturn: ...
@deprecated("Use YAML().dump() instead")
def round_trip_dump(*args, **kwargs) -> NoReturn: ...
def add_implicit_resolver(
tag: _TagStr,
tag: str,
regexp: Pattern[str],
first: list[_First] | None = None,
first: list[str] | None = None,
Loader: type[BaseResolver] | None = None,
Dumper: type[BaseResolver] | None = None,
resolver: type[BaseResolver] = ...,
) -> None: ...
def add_path_resolver(
tag: _TagStr,
tag: str,
path: Iterable[Any],
kind: type | None = None,
Loader: type[BaseResolver] | None = None,
Expand Down
1 change: 1 addition & 0 deletions stubs/ruamel.yaml/ruamel/yaml/nodes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ from .tokens import _CommentGroup, _ScalarStyle
_ScalarNodeStyle: TypeAlias = Literal["?", "-"] | _ScalarStyle

class Node:
id: ClassVar[str]
ctag: Tag
value: Any
start_mark: _Mark | None
Expand Down
12 changes: 6 additions & 6 deletions stubs/ruamel.yaml/ruamel/yaml/scalarstring.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing_extensions import Self

from .anchor import Anchor
from .comments import CommentedMap, CommentedSeq
from .nodes import _ScalarNodeStyle
from .tokens import _ScalarStyle

__all__ = [
"ScalarString",
Expand All @@ -25,28 +25,28 @@ class ScalarString(str):
def yaml_set_anchor(self, value: str, /, *, always_dump: bool = False) -> None: ...

class LiteralScalarString(ScalarString):
style: Final[_ScalarNodeStyle] = "|"
style: Final[_ScalarStyle] = "|"
comment: str
def __new__(cls, value: str, /, *, anchor: str | None = None) -> Self: ...

PreservedScalarString = LiteralScalarString

class FoldedScalarString(ScalarString):
style: Final[_ScalarNodeStyle] = ">"
style: Final[_ScalarStyle] = ">"
fold_pos: list[int]
comment: str
def __new__(cls, value: str, /, *, anchor: str | None = None) -> Self: ...

class SingleQuotedScalarString(ScalarString):
style: Final[_ScalarNodeStyle] = "'"
style: Final[_ScalarStyle] = "'"
def __new__(cls, value: str, /, *, anchor: str | None = None) -> Self: ...

class DoubleQuotedScalarString(ScalarString):
style: Final[_ScalarNodeStyle] = '"'
style: Final[_ScalarStyle] = '"'
def __new__(cls, value: str, /, *, anchor: str | None = None) -> Self: ...

class PlainScalarString(ScalarString):
style: Final[_ScalarNodeStyle] = ""
style: Final[_ScalarStyle] = ""
def __new__(cls, value: str, /, *, anchor: str | None = None) -> Self: ...

def preserve_literal(s: str, /) -> str: ...
Expand Down

0 comments on commit 1f10574

Please sign in to comment.