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 authored and GitHub committed 2021-08-07 08:10:03 -07:00
1 parent e3f662b648
commit b4385fa127
2 files changed
+6 -4

No files matched your search

+2 -1
View File
@@ -1 +1,2 @@
version = "0.1"
version = "3.6"
obsolete_since = "3.6.1"
+4 -3
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): ...