Annotate jmespath public API (#8253)

This commit is contained in:
Álvaro Mondéjar
2022-07-07 16:42:14 +02:00
committed by GitHub
parent 9a5c865034
commit 96bc17a40f
2 changed files with 14 additions and 6 deletions

View File

@@ -3,5 +3,5 @@ from typing import Any
from jmespath import parser as parser
from jmespath.visitor import Options as Options
def compile(expression): ...
def search(expression, data, options: Any | None = ...): ...
def compile(expression: str) -> parser.ParsedResult: ...
def search(expression: str, data: Any, options: Any | None = ...) -> Any: ...

View File

@@ -1,9 +1,17 @@
from typing import Any
from collections.abc import Callable
from typing import Any, TypeVar
from typing_extensions import NotRequired, TypedDict
TYPES_MAP: Any
REVERSE_TYPES_MAP: Any
TYPES_MAP: dict[str, str]
REVERSE_TYPES_MAP: dict[str, tuple[str, ...]]
def signature(*arguments): ...
class _Signature(TypedDict):
types: list[str]
variadic: NotRequired[bool]
_F = TypeVar("_F", bound=Callable[..., Any])
def signature(*arguments: _Signature) -> Callable[[_F], _F]: ...
class FunctionRegistry(type):
def __init__(cls, name, bases, attrs) -> None: ...