Skip to content

Commit fd62d20

Browse files
authored
Improve ujson (#13700)
1 parent 70ea8b3 commit fd62d20

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stubs/ujson/ujson.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from _typeshed import Incomplete, SupportsRead, SupportsWrite
1+
from _typeshed import SupportsRead, SupportsWrite
22
from collections.abc import Callable
3-
from typing import Any
3+
from typing import Any, Final
44

5-
__version__: str
5+
__version__: Final[str]
66

77
def encode(
88
obj: Any,
@@ -14,7 +14,7 @@ def encode(
1414
indent: int = ...,
1515
allow_nan: bool = ...,
1616
reject_bytes: bool = ...,
17-
default: Callable[[Incomplete], Incomplete] | None = None,
17+
default: Callable[[Any], Any] | None = None, # Specify how to serialize arbitrary types
1818
separators: tuple[str, str] | None = None,
1919
) -> str: ...
2020
def dumps(
@@ -27,7 +27,7 @@ def dumps(
2727
indent: int = ...,
2828
allow_nan: bool = ...,
2929
reject_bytes: bool = ...,
30-
default: Callable[[Incomplete], Incomplete] | None = None,
30+
default: Callable[[Any], Any] | None = None, # Specify how to serialize arbitrary types
3131
separators: tuple[str, str] | None = None,
3232
) -> str: ...
3333
def dump(
@@ -42,7 +42,7 @@ def dump(
4242
indent: int = ...,
4343
allow_nan: bool = ...,
4444
reject_bytes: bool = ...,
45-
default: Callable[[Incomplete], Incomplete] | None = None,
45+
default: Callable[[Any], Any] | None = None, # Specify how to serialize arbitrary types
4646
separators: tuple[str, str] | None = None,
4747
) -> None: ...
4848
def decode(s: str | bytes | bytearray, precise_float: bool = ...) -> Any: ...

0 commit comments

Comments
 (0)