summaryrefslogtreecommitdiff
path: root/jsonschema/protocols.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2023-03-15 14:01:08 -0400
committerJulian Berman <Julian@GrayVines.com>2023-03-15 14:01:08 -0400
commit69fc7b4eaf5ab622ac9cb7a20cd1039f0620184d (patch)
tree802928e9b3642c13a5d77289e89dc0bd23913c83 /jsonschema/protocols.py
parent8bdec0635103833dcb90fdef28d2ca070b6c97a3 (diff)
downloadjsonschema-69fc7b4eaf5ab622ac9cb7a20cd1039f0620184d.tar.gz
Newer attrs API in validators.py and some type hints for create.
Diffstat (limited to 'jsonschema/protocols.py')
-rw-r--r--jsonschema/protocols.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py
index 65f5898..340b711 100644
--- a/jsonschema/protocols.py
+++ b/jsonschema/protocols.py
@@ -7,7 +7,7 @@ typing.Protocol classes for jsonschema interfaces.
from __future__ import annotations
-from collections.abc import Callable, Mapping
+from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, ClassVar, Iterable
import sys
@@ -28,6 +28,7 @@ else:
# therefore, only import at type-checking time (to avoid circular references),
# but use `jsonschema` for any types which will otherwise not be resolvable
if TYPE_CHECKING:
+ from jsonschema import _typing
import jsonschema
import jsonschema.validators
import referencing.jsonschema
@@ -110,7 +111,7 @@ class Validator(Protocol):
FORMAT_CHECKER: ClassVar[jsonschema.FormatChecker]
#: A function which given a schema returns its ID.
- ID_OF: Callable[[Any], str | None]
+ ID_OF: _typing.id_of
#: The schema that will be used to validate instances
schema: Mapping | bool