1- from _typeshed import Incomplete , SupportsRichComparison
1+ from _typeshed import Incomplete , SupportsRichComparison , sentinel
22from collections import deque
3- from collections .abc import Callable , Container , Iterable , Iterator , MutableMapping , Sequence
3+ from collections .abc import Callable , Container , Iterable , Iterator , Mapping , MutableMapping , Sequence
4+ from typing import Any
45from typing_extensions import Self , TypeAlias , deprecated
56
6- from jsonschema import _utils , protocols
7- from jsonschema ._types import TypeChecker
7+ from ._types import TypeChecker
8+ from ._utils import Unset
9+ from .protocols import Validator
810
911_RelevanceFuncType : TypeAlias = Callable [[ValidationError ], SupportsRichComparison ]
1012
@@ -19,24 +21,24 @@ class _Error(Exception):
1921 relative_schema_path : deque [str | int ]
2022 context : list [ValidationError ] | None
2123 cause : Exception | None
22- validator : protocols . Validator | None
23- validator_value : Incomplete
24- instance : Incomplete
25- schema : Incomplete
24+ validator : Validator | Unset
25+ validator_value : Any | Unset
26+ instance : Any | Unset
27+ schema : Mapping [ str , Any ] | bool | Unset
2628 parent : _Error | None
2729 def __init__ (
2830 self ,
2931 message : str ,
30- validator : _utils . Unset | None | protocols . Validator = ... ,
31- path : Sequence [str | int ] = (),
32- cause : Incomplete | None = None ,
32+ validator : str | Unset = sentinel ,
33+ path : Iterable [str | int ] = (),
34+ cause : Exception | None = None ,
3335 context : Sequence [ValidationError ] = (),
34- validator_value = ... ,
35- instance = ... ,
36- schema = ... ,
37- schema_path : Sequence [str | int ] = (),
36+ validator_value : Any | Unset = sentinel ,
37+ instance : Any | Unset = sentinel ,
38+ schema : Mapping [ str , Any ] | bool | Unset = sentinel ,
39+ schema_path : Iterable [str | int ] = (),
3840 parent : _Error | None = None ,
39- type_checker : _utils . Unset | TypeChecker = ... ,
41+ type_checker : TypeChecker | Unset = sentinel ,
4042 ) -> None : ...
4143 @classmethod
4244 def create_from (cls , other : _Error ) -> Self : ...
0 commit comments