Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions stubs/PyYAML/yaml/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,22 @@ def add_path_resolver(

@overload
def add_constructor(
tag: str, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Incomplete], Loader: None = None
tag: str | None, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Incomplete], Loader: None = None
) -> None: ...
@overload
def add_constructor(tag: str, constructor: Callable[[_Constructor, Node], Incomplete], Loader: type[_Constructor]) -> None: ...
def add_constructor(
tag: str | None, 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], Incomplete], Loader: None = None
tag_prefix: str | None,
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], Incomplete], Loader: type[_Constructor]
tag_prefix: str | None, multi_constructor: Callable[[_Constructor, str, Node], Incomplete], Loader: type[_Constructor]
) -> None: ...

@overload
Expand Down
2 changes: 1 addition & 1 deletion stubs/PyYAML/yaml/constructor.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BaseConstructor:
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], Incomplete]) -> None: ...
def add_constructor(cls, tag: str | None, constructor: Callable[[_L, _N], Incomplete]) -> None: ...
@classmethod
def add_multi_constructor(cls, tag_prefix: str | None, multi_constructor) -> None: ...

Expand Down
Loading