|
1 |
| -def to_bytes(x, charset: str = "utf-8", errors: str = "strict") -> bytes | None: ... |
2 |
| -def to_unicode(x, charset: str = "utf-8", errors: str = "strict") -> str | None: ... |
3 |
| -def to_native(x, encoding: str = "ascii"): ... |
4 |
| -def json_loads(s): ... |
5 |
| -def json_dumps(data, ensure_ascii: bool = False): ... |
6 |
| -def urlsafe_b64decode(s): ... |
7 |
| -def urlsafe_b64encode(s): ... |
8 |
| -def base64_to_int(s): ... |
9 |
| -def int_to_base64(num): ... |
10 |
| -def json_b64encode(text): ... |
| 1 | +from _typeshed import ReadableBuffer |
| 2 | +from collections.abc import Iterable |
| 3 | +from typing import Any, SupportsBytes, SupportsIndex, overload |
| 4 | + |
| 5 | +@overload |
| 6 | +def to_bytes(x: None, charset: str = "utf-8", errors: str = "strict") -> None: ... |
| 7 | +@overload |
| 8 | +def to_bytes( |
| 9 | + x: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, |
| 10 | + charset: str = "utf-8", |
| 11 | + errors: str = "strict", |
| 12 | +) -> bytes: ... |
| 13 | +@overload |
| 14 | +def to_unicode(x: None, charset: str = "utf-8", errors: str = "strict") -> None: ... |
| 15 | +@overload |
| 16 | +def to_unicode(x: object, charset: str = "utf-8", errors: str = "strict") -> str: ... |
| 17 | +def to_native(x: str | bytes, encoding: str = "ascii") -> str: ... |
| 18 | +def json_loads(s: str | bytes | bytearray) -> Any: ... # returns json.loads() |
| 19 | +def json_dumps(data: Any, ensure_ascii: bool = False) -> str: ... # data pass to json.dumps() |
| 20 | +def urlsafe_b64decode(s: bytes) -> bytes: ... |
| 21 | +def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ... |
| 22 | +def base64_to_int(s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> int: ... |
| 23 | +def int_to_base64(num: int) -> str: ... |
| 24 | +def json_b64encode( |
| 25 | + text: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, |
| 26 | +) -> bytes: ... |
0 commit comments