Skip to content

Commit

Permalink
change Any to Incomplete (for some unkhown reason)
Browse files Browse the repository at this point in the history
  • Loading branch information
DinhHuy2010 committed Feb 28, 2025
1 parent ce0d9fa commit 0460e9f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 34 deletions.
7 changes: 4 additions & 3 deletions stubs/ijson/ijson/backends/_yajl2_ctypes_common.pyi
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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: ...
15 changes: 7 additions & 8 deletions stubs/ijson/ijson/backends/python.pyi
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
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]

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(
target: Generator[None, tuple[int, str | None]],
multiple_values: bool = False,
allow_comments: bool = False,
use_float: bool = False,
): ...
) -> Generator[None, bytes]: ...
27 changes: 14 additions & 13 deletions stubs/ijson/ijson/common.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
9 changes: 5 additions & 4 deletions stubs/ijson/ijson/utils.pyi
Original file line number Diff line number Diff line change
@@ -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]: ...
12 changes: 6 additions & 6 deletions stubs/ijson/ijson/utils35.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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): ...

0 comments on commit 0460e9f

Please sign in to comment.