mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-26 19:47:14 +08:00
Add defaults for third-party stubs Q-T (#9959)
This commit is contained in:
@@ -31,18 +31,18 @@ class CommentValue:
|
||||
def load(
|
||||
f: _PathLike | list[Any] | SupportsRead[str], # list[_PathLike] is invariance
|
||||
_dict: type[_MutableMappingT],
|
||||
decoder: TomlDecoder[_MutableMappingT] | None = ...,
|
||||
decoder: TomlDecoder[_MutableMappingT] | None = None,
|
||||
) -> _MutableMappingT: ...
|
||||
@overload
|
||||
def load(
|
||||
f: _PathLike | list[Any] | SupportsRead[str], # list[_PathLike] is invariance
|
||||
_dict: type[dict[str, Any]] = ...,
|
||||
decoder: TomlDecoder[dict[str, Any]] | None = ...,
|
||||
decoder: TomlDecoder[dict[str, Any]] | None = None,
|
||||
) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def loads(s: str, _dict: type[_MutableMappingT], decoder: TomlDecoder[_MutableMappingT] | None = ...) -> _MutableMappingT: ...
|
||||
def loads(s: str, _dict: type[_MutableMappingT], decoder: TomlDecoder[_MutableMappingT] | None = None) -> _MutableMappingT: ...
|
||||
@overload
|
||||
def loads(s: str, _dict: type[dict[str, Any]] = ..., decoder: TomlDecoder[dict[str, Any]] | None = ...) -> dict[str, Any]: ...
|
||||
def loads(s: str, _dict: type[dict[str, Any]] = ..., decoder: TomlDecoder[dict[str, Any]] | None = None) -> dict[str, Any]: ...
|
||||
|
||||
class InlineTableDict: ...
|
||||
|
||||
@@ -55,12 +55,12 @@ class TomlDecoder(Generic[_MutableMappingT]):
|
||||
def get_empty_table(self) -> _MutableMappingT: ...
|
||||
def get_empty_inline_table(self) -> InlineTableDict: ... # incomplete python/typing#213
|
||||
def load_inline_object(
|
||||
self, line: str, currentlevel: _MutableMappingT, multikey: bool = ..., multibackslash: bool = ...
|
||||
self, line: str, currentlevel: _MutableMappingT, multikey: bool = False, multibackslash: bool = False
|
||||
) -> None: ...
|
||||
def load_line(
|
||||
self, line: str, currentlevel: _MutableMappingT, multikey: bool | None, multibackslash: bool
|
||||
) -> tuple[bool | None, str, bool] | None: ...
|
||||
def load_value(self, v: str, strictly_valid: bool = ...) -> tuple[Any, str]: ...
|
||||
def load_value(self, v: str, strictly_valid: bool = True) -> tuple[Any, str]: ...
|
||||
def bounded_string(self, s: str) -> bool: ...
|
||||
def load_array(self, a: str) -> list[Any]: ...
|
||||
def preserve_comment(self, line_no: int, key: str, comment: str, beginline: bool) -> None: ...
|
||||
|
||||
@@ -4,17 +4,17 @@ from typing import Any, Generic, TypeVar, overload
|
||||
|
||||
_MappingT = TypeVar("_MappingT", bound=Mapping[str, Any])
|
||||
|
||||
def dump(o: _MappingT, f: SupportsWrite[str], encoder: TomlEncoder[_MappingT] | None = ...) -> str: ...
|
||||
def dumps(o: _MappingT, encoder: TomlEncoder[_MappingT] | None = ...) -> str: ...
|
||||
def dump(o: _MappingT, f: SupportsWrite[str], encoder: TomlEncoder[_MappingT] | None = None) -> str: ...
|
||||
def dumps(o: _MappingT, encoder: TomlEncoder[_MappingT] | None = None) -> str: ...
|
||||
|
||||
class TomlEncoder(Generic[_MappingT]):
|
||||
_dict: type[_MappingT]
|
||||
preserve: bool
|
||||
dump_funcs: MutableMapping[type[Any], Callable[[Any], str]]
|
||||
@overload
|
||||
def __init__(self, _dict: type[_MappingT], preserve: bool = ...) -> None: ...
|
||||
def __init__(self, _dict: type[_MappingT], preserve: bool = False) -> None: ...
|
||||
@overload
|
||||
def __init__(self: TomlEncoder[dict[str, Any]], _dict: type[dict[str, Any]] = ..., preserve: bool = ...) -> None: ...
|
||||
def __init__(self: TomlEncoder[dict[str, Any]], _dict: type[dict[str, Any]] = ..., preserve: bool = False) -> None: ...
|
||||
def get_empty_table(self) -> _MappingT: ...
|
||||
def dump_list(self, v: Iterable[Any]) -> str: ...
|
||||
def dump_inline_table(self, section: dict[str, Any] | Any) -> str: ...
|
||||
@@ -30,13 +30,13 @@ class TomlPreserveInlineDictEncoder(TomlEncoder[_MappingT]):
|
||||
class TomlArraySeparatorEncoder(TomlEncoder[_MappingT]):
|
||||
separator: str
|
||||
@overload
|
||||
def __init__(self, _dict: type[_MappingT], preserve: bool = ..., separator: str = ...) -> None: ...
|
||||
def __init__(self, _dict: type[_MappingT], preserve: bool = False, separator: str = ",") -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: TomlArraySeparatorEncoder[dict[str, Any]],
|
||||
_dict: type[dict[str, Any]] = ...,
|
||||
preserve: bool = ...,
|
||||
separator: str = ...,
|
||||
preserve: bool = False,
|
||||
separator: str = ",",
|
||||
) -> None: ...
|
||||
def dump_list(self, v: Iterable[Any]) -> str: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user