Skip to content

Commit 7fd4d38

Browse files
committed
Add typing to _Error.__init__
1 parent efa28c6 commit 7fd4d38

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

jsonschema/exceptions.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from __future__ import annotations
55

66
from collections import defaultdict, deque
7+
from collections.abc import Iterable, Mapping
78
from pprint import pformat
89
from textwrap import dedent, indent
910
from typing import TYPE_CHECKING, Any, ClassVar
@@ -31,17 +32,17 @@ class _Error(Exception):
3132
def __init__(
3233
self,
3334
message: str,
34-
validator=_unset,
35-
path=(),
36-
cause=None,
35+
validator: str | _utils.Unset = _unset,
36+
path: Iterable[str | int] = (),
37+
cause: Exception | None = None,
3738
context=(),
3839
validator_value=_unset,
39-
instance=_unset,
40-
schema=_unset,
41-
schema_path=(),
42-
parent=None,
43-
type_checker=_unset,
44-
):
40+
instance: Any = _unset,
41+
schema: Mapping[str, Any] | bool | _utils.Unset = _unset,
42+
schema_path: Iterable[str | int] = (),
43+
parent: _Error | None = None,
44+
type_checker: _types.TypeChecker | _utils.Unset = _unset,
45+
) -> None:
4546
super(_Error, self).__init__(
4647
message,
4748
validator,

0 commit comments

Comments
 (0)