diff --git a/stubs/ijson/ijson/backends/_yajl2_ctypes_common.pyi b/stubs/ijson/ijson/backends/_yajl2_ctypes_common.pyi index 6ef3e2acda29..d0b27d7679aa 100644 --- a/stubs/ijson/ijson/backends/_yajl2_ctypes_common.pyi +++ b/stubs/ijson/ijson/backends/_yajl2_ctypes_common.pyi @@ -1,6 +1,7 @@ from _ctypes import Structure +from _typeshed import Incomplete from ctypes import CDLL, _CFunctionType -from typing import Any, ClassVar +from typing import ClassVar C_EMPTY: type[_CFunctionType] C_INT: type[_CFunctionType] @@ -17,5 +18,5 @@ class _CallbacksStructure(Structure): _fields_: ClassVar[list[tuple[str, type[_CFunctionType]]]] def get_yajl(version: int) -> CDLL: ... -def make_callbaks(send: Any, use_float: bool, yajl_version: int) -> _CallbacksStructure: ... -def yajl_get_error(yajl: Any, handle, buffer) -> str | bytes | None: ... +def make_callbaks(send: Incomplete, use_float: bool, yajl_version: int) -> _CallbacksStructure: ... +def yajl_get_error(yajl: Incomplete, handle, buffer) -> str | bytes | None: ... diff --git a/stubs/ijson/ijson/backends/python.pyi b/stubs/ijson/ijson/backends/python.pyi index d8d8c712b97e..2cf03255f667 100644 --- a/stubs/ijson/ijson/backends/python.pyi +++ b/stubs/ijson/ijson/backends/python.pyi @@ -1,9 +1,11 @@ +from _typeshed import Incomplete from collections.abc import Generator from re import Pattern -from typing import Any, Literal +from typing import Literal from ijson import common +inf = float("inf") LEXEME_RE: Pattern[str] UNARY_LEXEMES: set[str] EOF: tuple[Literal[-1], None] @@ -11,13 +13,10 @@ EOF: tuple[Literal[-1], None] class UnexpectedSymbol(common.JSONError): def __init__(self, symbol: str, pos: int) -> None: ... -def utf8_encoder(target: Any) -> Generator[None, bytes]: ... -def Lexer(target: Generator[Any, bytes]) -> Generator[None, tuple[int, str]]: ... - -inf = float("inf") - +def utf8_encoder(target: Incomplete) -> Generator[None, bytes]: ... +def Lexer(target: Generator[Incomplete, bytes]) -> Generator[None, tuple[int, str]]: ... def parse_value( - target: Generator[Any, tuple[str, object]], multivalue: bool, use_float: bool + target: Generator[Incomplete, tuple[str, object]], multivalue: bool, use_float: bool ) -> Generator[None, tuple[int, str | None]]: ... def parse_string(symbol: str) -> str: ... def basic_parse_basecoro( @@ -25,4 +24,4 @@ def basic_parse_basecoro( multiple_values: bool = False, allow_comments: bool = False, use_float: bool = False, -): ... +) -> Generator[None, bytes]: ... diff --git a/stubs/ijson/ijson/common.pyi b/stubs/ijson/ijson/common.pyi index 8d0e1f72eeb6..e388497dbd36 100644 --- a/stubs/ijson/ijson/common.pyi +++ b/stubs/ijson/ijson/common.pyi @@ -1,33 +1,34 @@ from _typeshed import Incomplete, ReadableBuffer, SupportsRead from collections.abc import Callable, Generator, Iterable, MutableMapping from decimal import Decimal -from typing import Any from typing_extensions import TypeGuard class JSONError(Exception): ... class IncompleteJSONError(JSONError): ... -def parse_basecoro(target: Generator[Any, tuple[str, str, Any]]) -> Generator[None, None, None]: ... +def parse_basecoro(target: Generator[Incomplete, tuple[str, str, Incomplete]]) -> Generator[None, None, None]: ... class ObjectBuilder: - value: Any + value: Incomplete containers: list[Callable[[object], object]] - map_type: type[MutableMapping[Any, Any]] - def __init__(self, map_type: type[MutableMapping[Any, Any]] | None = None) -> None: ... - key: Any - def event(self, event: str, value: Any) -> None: ... + map_type: type[MutableMapping[Incomplete, Incomplete]] + def __init__(self, map_type: type[MutableMapping[Incomplete, Incomplete]] | None = None) -> None: ... + key: Incomplete + def event(self, event: str, value: Incomplete) -> None: ... -def items_basecoro(target, prefix, map_type: Incomplete | None = None) -> Generator[None, Incomplete]: ... +def items_basecoro( + target: Generator[object, tuple[Incomplete, str, object]], prefix: Incomplete, map_type: Incomplete | None = None +) -> Generator[None, Incomplete]: ... def kvitems_basecoro(target, prefix, map_type: Incomplete | None = None) -> Generator[None, Incomplete]: ... def integer_or_decimal(str_value: str): ... def integer_or_float(str_value: str) -> Decimal | int: ... def number(str_value: str) -> int | float: ... def file_source(f: SupportsRead[str] | SupportsRead[ReadableBuffer], buf_size: int = 65536) -> Generator[bytes]: ... -def is_awaitablefunction(func: Callable[..., Any]) -> bool: ... -def is_async_file(f: Any) -> bool: ... -def is_file(x: object) -> TypeGuard[SupportsRead[Any]]: ... -def is_iterable(x: object) -> TypeGuard[Iterable[Any]]: ... +def is_awaitablefunction(func: Callable[..., Incomplete]) -> bool: ... +def is_async_file(f: Incomplete) -> bool: ... +def is_file(x: object) -> TypeGuard[SupportsRead[Incomplete]]: ... +def is_iterable(x: object) -> TypeGuard[Iterable[Incomplete]]: ... def parse(events): ... def kvitems(events, prefix, map_type: Incomplete | None = None): ... def items(events, prefix, map_type: Incomplete | None = None): ... -def enrich_backend(backend: dict[str, Any]) -> None: ... +def enrich_backend(backend: dict[str, Incomplete]) -> None: ... diff --git a/stubs/ijson/ijson/utils.pyi b/stubs/ijson/ijson/utils.pyi index 2cd143a1044f..ce241d73037d 100644 --- a/stubs/ijson/ijson/utils.pyi +++ b/stubs/ijson/ijson/utils.pyi @@ -1,18 +1,19 @@ +from _typeshed import Incomplete from collections.abc import Callable, Generator -from typing import Any, Iterable, TypeVar +from typing import Iterable, TypeVar from typing_extensions import ParamSpec, TypeAlias _P = ParamSpec("_P") _T = TypeVar("_T") _GS = TypeVar("_GS") _GR = TypeVar("_GR") -_CoroPipelineArgs: TypeAlias = tuple[Callable[..., Any], tuple[Any, ...], dict[str, Any]] +_CoroPipelineArgs: TypeAlias = tuple[Callable[..., Incomplete], tuple[Incomplete, ...], dict[str, Incomplete]] def coroutine(func: Callable[_P, Generator[_T, _GS, _GR]]) -> Callable[_P, Generator[_T, _GS, _GR]]: ... -def chain(sink: list[Any], *coro_pipeline: _CoroPipelineArgs) -> list[Any]: ... +def chain(sink: list[Incomplete], *coro_pipeline: _CoroPipelineArgs) -> list[Incomplete]: ... class sendable_list(list[_T]): # send = list.append def send(self, object: _T, /) -> None: ... -def coros2gen(source: Iterable[_T], *coro_pipeline: _CoroPipelineArgs) -> Generator[_T, Any, None]: ... +def coros2gen(source: Iterable[_T], *coro_pipeline: _CoroPipelineArgs) -> Generator[_T, Incomplete, None]: ... diff --git a/stubs/ijson/ijson/utils35.pyi b/stubs/ijson/ijson/utils35.pyi index 3d01f3afa9fb..18823b2c235a 100644 --- a/stubs/ijson/ijson/utils35.pyi +++ b/stubs/ijson/ijson/utils35.pyi @@ -1,7 +1,7 @@ import collections -from _typeshed import SupportsRead +from _typeshed import Incomplete, SupportsRead from collections.abc import Callable -from typing import Any, TypeVar +from typing import TypeVar from ijson import compat from ijson.utils import _CoroPipelineArgs @@ -16,12 +16,12 @@ class sendable_deque(collections.deque[_T]): def send(self, x: _T, /) -> None: ... class async_iterable: - events: sendable_deque[Any] - coro: list[Any] + events: sendable_deque[Incomplete] + coro: list[Incomplete] coro_finished: bool - f: SupportsRead[Any] + f: SupportsRead[Incomplete] buf_size: int read: Callable[[int], bytes] | None - def __init__(self, f: SupportsRead[Any], buf_size: int, *coro_pipeline: _CoroPipelineArgs) -> None: ... + def __init__(self, f: SupportsRead[Incomplete], buf_size: int, *coro_pipeline: _CoroPipelineArgs) -> None: ... def __aiter__(self): ... async def __anext__(self): ...