Skip to content

Commit 0024b58

Browse files
committed
Remove references to Unset in the typing annotations.
I don't want them appearing in public documentation. The public types of these arguments do not include Unset, a user may only pass them the declared type, even though internally the type is larger. Refs: #1019 (comment)
1 parent 0151efd commit 0024b58

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

jsonschema/exceptions.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ class _Error(Exception):
4646
def __init__(
4747
self,
4848
message: str,
49-
validator: str | _utils.Unset = _unset,
49+
validator: str = _unset, # type: ignore[assignment]
5050
path: Iterable[str | int] = (),
5151
cause: Exception | None = None,
5252
context=(),
5353
validator_value: Any = _unset,
5454
instance: Any = _unset,
55-
schema: Mapping[str, Any] | bool | _utils.Unset = _unset,
55+
schema: Mapping[str, Any] | bool = _unset, # type: ignore[assignment]
5656
schema_path: Iterable[str | int] = (),
5757
parent: _Error | None = None,
58-
type_checker: _types.TypeChecker | _utils.Unset = _unset,
58+
type_checker: _types.TypeChecker = _unset, # type: ignore[assignment]
5959
) -> None:
6060
super().__init__(
6161
message,
@@ -176,9 +176,6 @@ def _matches_type(self) -> bool:
176176
except (KeyError, TypeError):
177177
return False
178178

179-
if isinstance(self._type_checker, _utils.Unset):
180-
return False
181-
182179
if isinstance(expected, str):
183180
return self._type_checker.is_type(self.instance, expected)
184181

0 commit comments

Comments
 (0)