mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Modernize orjson stub (#5870)
* Use | instead of Union and Optional * Import Callable from collections.abc, not typing * Set version in METADATA * Remove redundant "bytearray" from argument type * Add obsolete_since metadata field
This commit is contained in:
@@ -1 +1,2 @@
|
||||
version = "0.1"
|
||||
version = "3.6"
|
||||
obsolete_since = "3.6.1"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from typing import Any, Callable, Optional, Union
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
__version__: str
|
||||
|
||||
def dumps(__obj: Any, default: Optional[Callable[[Any], Any]] = ..., option: Optional[int] = ...) -> bytes: ...
|
||||
def loads(__obj: Union[bytes, bytearray, str]) -> Any: ...
|
||||
def dumps(__obj: Any, default: Callable[[Any], Any] | None = ..., option: int | None = ...) -> bytes: ...
|
||||
def loads(__obj: bytes | str) -> Any: ...
|
||||
|
||||
class JSONDecodeError(ValueError): ...
|
||||
class JSONEncodeError(TypeError): ...
|
||||
|
||||
Reference in New Issue
Block a user