diff --git a/stubs/jsonschema/jsonschema/_format.pyi b/stubs/jsonschema/jsonschema/_format.pyi index db0f500d57c3..cb8ed7a94cad 100644 --- a/stubs/jsonschema/jsonschema/_format.pyi +++ b/stubs/jsonschema/jsonschema/_format.pyi @@ -1,15 +1,15 @@ from collections.abc import Iterable from typing import Any, Callable, TypeVar -F = TypeVar("F", bound=Callable[..., Any]) +_F = TypeVar("_F", bound=Callable[..., Any]) class FormatChecker: - checkers: dict[str, tuple[Callable[[Any], bool], Exception | tuple[Exception, ...],],] + checkers: dict[str, tuple[Callable[[Any], bool], Exception | tuple[Exception, ...]]] def __init__(self, formats: Iterable[str] | None = ...) -> None: ... - def checks(self, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[F], F]: ... + def checks(self, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[_F], _F]: ... @classmethod - def cls_checks(cls, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[F], F]: ... + def cls_checks(cls, format: str, raises: Exception | tuple[Exception, ...] = ...) -> Callable[[_F], _F]: ... def check(self, instance: Any, format: str) -> None: ... def conforms(self, instance: Any, format: str) -> bool: ... diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index d80c89fa6b86..d1b1f87704ac 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -1,11 +1,11 @@ from _typeshed import Self from collections import deque -from collections.abc import Container -from typing import Any, Callable, Iterable, Sequence +from collections.abc import Callable, Container, Iterable, Sequence +from typing import Any from jsonschema import _utils, protocols -RelevanceFuncType = Callable[[ValidationError], Any] +_RelevanceFuncType = Callable[[ValidationError], Any] WEAK_MATCHES: frozenset[str] STRONG_MATCHES: frozenset[str] @@ -78,8 +78,8 @@ class ErrorTree: @property def total_errors(self): ... -def by_relevance(weak: Container[str] = ..., strong: Container[str] = ...) -> RelevanceFuncType: ... +def by_relevance(weak: Container[str] = ..., strong: Container[str] = ...) -> _RelevanceFuncType: ... -relevance: RelevanceFuncType +relevance: _RelevanceFuncType -def best_match(errors: Iterable[ValidationError], key: RelevanceFuncType = ...): ... +def best_match(errors: Iterable[ValidationError], key: _RelevanceFuncType = ...): ...