Manual changes of Any union to Incomplete in stubs folder (#9566)

- ClassVar[Any | None]
- Missed previous changes due to alias
- Manual review of leftover Any unions (`| Any` and `Any |`)
This commit is contained in:
Avasam
2023-02-02 09:48:41 -05:00
committed by GitHub
parent 95dc689b28
commit f1aede7162
12 changed files with 32 additions and 22 deletions

View File

@@ -2,6 +2,9 @@ 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

View File

@@ -1,5 +1,5 @@
import datetime
from _typeshed import SupportsItems
from _typeshed import Incomplete, SupportsItems
from collections.abc import Callable, Iterable, Mapping
from types import BuiltinFunctionType, FunctionType, ModuleType
from typing import Any, ClassVar, NoReturn, TypeVar
@@ -15,12 +15,12 @@ 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]]]
default_style: str | Any
default_style: str | Incomplete
sort_keys: bool
default_flow_style: bool
represented_objects: dict[int, Node]
object_keeper: list[Any]
alias_key: int | Any
alias_key: int | Incomplete
def __init__(self, default_style: str | None = ..., default_flow_style: bool = ..., sort_keys: bool = ...) -> None: ...
def represent(self, data) -> None: ...
def represent_data(self, data) -> Node: ...