mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 09:18:40 +08:00
Replace Any with Incomplete in many places (#9558)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from _typeshed import Self, SupportsRichComparison
|
||||
from _typeshed import Incomplete, Self, SupportsRichComparison
|
||||
from collections import deque
|
||||
from collections.abc import Callable, Container, Iterable, Sequence
|
||||
from typing import Any
|
||||
@@ -30,7 +30,7 @@ class _Error(Exception):
|
||||
message: str,
|
||||
validator: _utils.Unset | None | protocols.Validator = ...,
|
||||
path: Sequence[str | int] = ...,
|
||||
cause: Any | None = ...,
|
||||
cause: Incomplete | None = ...,
|
||||
context: Sequence[ValidationError] = ...,
|
||||
validator_value=...,
|
||||
instance: Any = ...,
|
||||
@@ -70,7 +70,7 @@ class UnknownType(Exception):
|
||||
class FormatError(Exception):
|
||||
message: Any
|
||||
cause: Any
|
||||
def __init__(self, message, cause: Any | None = ...) -> None: ...
|
||||
def __init__(self, message, cause: Incomplete | None = ...) -> None: ...
|
||||
|
||||
class ErrorTree:
|
||||
errors: Any
|
||||
|
||||
@@ -29,12 +29,12 @@ class _Validator:
|
||||
resolver: Any
|
||||
format_checker: Any
|
||||
evolve: Any
|
||||
def __init__(self, schema: _Schema, resolver: Any | None = ..., format_checker: Any | None = ...) -> None: ...
|
||||
def __init__(self, schema: _Schema, resolver: Incomplete | None = ..., format_checker: Incomplete | None = ...) -> None: ...
|
||||
@classmethod
|
||||
def check_schema(cls, schema: _Schema, format_checker: FormatChecker | Unset = ...) -> None: ...
|
||||
def iter_errors(self, instance, _schema: _Schema | None = ...) -> Generator[Any, None, None]: ...
|
||||
def descend(
|
||||
self, instance, schema: _Schema, path: Any | None = ..., schema_path: Any | None = ...
|
||||
self, instance, schema: _Schema, path: Incomplete | None = ..., schema_path: Incomplete | None = ...
|
||||
) -> Generator[Any, None, None]: ...
|
||||
def validate(self, *args, **kwargs) -> None: ...
|
||||
def is_type(self, instance, type): ...
|
||||
@@ -44,14 +44,18 @@ def validates(version: str) -> Callable[..., Any]: ...
|
||||
def create(
|
||||
meta_schema: _Schema,
|
||||
validators: Mapping[str, _ValidatorCallback] | tuple[()] = ...,
|
||||
version: Any | None = ...,
|
||||
version: Incomplete | None = ...,
|
||||
type_checker: TypeChecker = ...,
|
||||
format_checker: FormatChecker = ...,
|
||||
id_of: Callable[[_Schema], str] = ...,
|
||||
applicable_validators: Callable[[_Schema], Iterable[tuple[str, _ValidatorCallback]]] = ...,
|
||||
) -> type[_Validator]: ...
|
||||
def extend(
|
||||
validator, validators=..., version: Any | None = ..., type_checker: Any | None = ..., format_checker: Any | None = ...
|
||||
validator,
|
||||
validators=...,
|
||||
version: Incomplete | None = ...,
|
||||
type_checker: Incomplete | None = ...,
|
||||
format_checker: Incomplete | None = ...,
|
||||
): ...
|
||||
|
||||
# At runtime these are fields that are assigned the return values of create() calls.
|
||||
@@ -76,8 +80,8 @@ class RefResolver:
|
||||
store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ...,
|
||||
cache_remote: bool = ...,
|
||||
handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = ...,
|
||||
urljoin_cache: Any | None = ...,
|
||||
remote_cache: Any | None = ...,
|
||||
urljoin_cache: Incomplete | None = ...,
|
||||
remote_cache: Incomplete | None = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_schema(cls, schema: _Schema, id_of=..., *args, **kwargs): ...
|
||||
|
||||
Reference in New Issue
Block a user