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:
Sebastian Rittau
2021-08-07 17:10:03 +02:00
committed by GitHub
parent e3f662b648
commit b4385fa127
2 changed files with 6 additions and 4 deletions

View File

@@ -1 +1,2 @@
version = "0.1"
version = "3.6"
obsolete_since = "3.6.1"

View File

@@ -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): ...