Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions stubs/simplejson/simplejson/decoder.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from collections.abc import Callable
from re import Match
from typing import Any, Literal
Expand All @@ -14,11 +13,14 @@ class JSONDecoder:
strict: bool
array_hook: Callable[[list[Any]], Any] | None # transforms a JSON value to an arbitrary value
# They have many parameters, it might be better to use Protocol:
parse_object: Callable[..., tuple[Incomplete, int]]
parse_array: Callable[..., tuple[Incomplete, int]]
parse_string: Callable[..., tuple[Incomplete, int]]
# Any represents the decoded JSON object (dict, or custom value from hook)
parse_object: Callable[..., tuple[Any, int]]
# Any represents the decoded JSON array (list, or custom value from hook)
parse_array: Callable[..., tuple[Any, int]]
parse_string: Callable[..., tuple[str, int]]
memo: dict[Any, Any]
scan_once: Callable[[str, int], tuple[bool, int]]
# Any represents the decoded JSON value (str, int, float, bool, list, dict, None)
scan_once: Callable[[str, int], tuple[Any, int]]
Comment on lines +17 to +23

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need unobvious Anys to be documented (using comments). Please add a comment what Any means here.


def __init__(
self,
Expand Down
Loading