| 1 | import sys |
| 2 | from _typeshed import SupportsRead |
| 3 | from collections.abc import Callable |
| 4 | from typing import Any, overload |
| 5 | from typing_extensions import deprecated |
| 6 | |
| 7 | __all__ = ("loads", "load", "TOMLDecodeError") |
| 8 | |
| 9 | if sys.version_info >= (3, 14): |
| 10 | class TOMLDecodeError(ValueError): |
| 11 | msg: str |
| 12 | doc: str |
| 13 | pos: int |
| 14 | lineno: int |
| 15 | colno: int |
| 16 | @overload |
| 17 | def __init__(self, msg: str, doc: str, pos: int) -> None: ... |
| 18 | @overload |
| 19 | @deprecated("Deprecated since Python 3.14. Set the 'msg', 'doc' and 'pos' arguments only.") |
| 20 | def __init__(self, msg: str | type = ..., doc: str | type = ..., pos: int | type = ..., *args: Any) -> None: ... |
| 21 | |
| 22 | else: |
| 23 | class TOMLDecodeError(ValueError): ... |
| 24 | |
| 25 | def load(fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... |
| 26 | def loads(s: str, /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... |