mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 22:11:54 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from _typeshed import SupportsRead
|
||||
from typing import IO, Any, Callable, Dict, List, Text, Tuple, Type
|
||||
from typing import IO, Any, Callable, Text
|
||||
|
||||
def dumps(
|
||||
obj: Any,
|
||||
@@ -7,9 +7,9 @@ def dumps(
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Type[JSONEncoder] | None = ...,
|
||||
cls: type[JSONEncoder] | None = ...,
|
||||
indent: int | None = ...,
|
||||
separators: Tuple[str, str] | None = ...,
|
||||
separators: tuple[str, str] | None = ...,
|
||||
encoding: str = ...,
|
||||
default: Callable[[Any], Any] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
@@ -22,9 +22,9 @@ def dump(
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Type[JSONEncoder] | None = ...,
|
||||
cls: type[JSONEncoder] | None = ...,
|
||||
indent: int | None = ...,
|
||||
separators: Tuple[str, str] | None = ...,
|
||||
separators: tuple[str, str] | None = ...,
|
||||
encoding: str = ...,
|
||||
default: Callable[[Any], Any] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
@@ -33,23 +33,23 @@ def dump(
|
||||
def loads(
|
||||
s: Text | bytes,
|
||||
encoding: Any = ...,
|
||||
cls: Type[JSONDecoder] | None = ...,
|
||||
object_hook: Callable[[Dict[Any, Any]], Any] | None = ...,
|
||||
cls: type[JSONDecoder] | None = ...,
|
||||
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
|
||||
parse_float: Callable[[str], Any] | None = ...,
|
||||
parse_int: Callable[[str], Any] | None = ...,
|
||||
parse_constant: Callable[[str], Any] | None = ...,
|
||||
object_pairs_hook: Callable[[List[Tuple[Any, Any]]], Any] | None = ...,
|
||||
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
|
||||
**kwds: Any,
|
||||
) -> Any: ...
|
||||
def load(
|
||||
fp: SupportsRead[Text | bytes],
|
||||
encoding: str | None = ...,
|
||||
cls: Type[JSONDecoder] | None = ...,
|
||||
object_hook: Callable[[Dict[Any, Any]], Any] | None = ...,
|
||||
cls: type[JSONDecoder] | None = ...,
|
||||
object_hook: Callable[[dict[Any, Any]], Any] | None = ...,
|
||||
parse_float: Callable[[str], Any] | None = ...,
|
||||
parse_int: Callable[[str], Any] | None = ...,
|
||||
parse_constant: Callable[[str], Any] | None = ...,
|
||||
object_pairs_hook: Callable[[List[Tuple[Any, Any]]], Any] | None = ...,
|
||||
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
|
||||
**kwds: Any,
|
||||
) -> Any: ...
|
||||
|
||||
@@ -65,7 +65,7 @@ class JSONDecoder(object):
|
||||
object_pairs_hook: Callable[..., Any] = ...,
|
||||
) -> None: ...
|
||||
def decode(self, s: Text | bytes, _w: Any = ...) -> Any: ...
|
||||
def raw_decode(self, s: Text | bytes, idx: int = ...) -> Tuple[Any, Any]: ...
|
||||
def raw_decode(self, s: Text | bytes, idx: int = ...) -> tuple[Any, Any]: ...
|
||||
|
||||
class JSONEncoder(object):
|
||||
item_separator: str
|
||||
@@ -84,7 +84,7 @@ class JSONEncoder(object):
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: int | None = ...,
|
||||
separators: Tuple[Text | bytes, Text | bytes] = ...,
|
||||
separators: tuple[Text | bytes, Text | bytes] = ...,
|
||||
encoding: Text | bytes = ...,
|
||||
default: Callable[..., Any] = ...,
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user