mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 20:45:49 +08:00
5e0d6ee95e
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
27 lines
937 B
Python
27 lines
937 B
Python
import sys
|
|
from _typeshed import SupportsRead
|
|
from collections.abc import Callable
|
|
from typing import Any, overload
|
|
from typing_extensions import deprecated
|
|
|
|
__all__ = ("loads", "load", "TOMLDecodeError")
|
|
|
|
if sys.version_info >= (3, 14):
|
|
class TOMLDecodeError(ValueError):
|
|
msg: str
|
|
doc: str
|
|
pos: int
|
|
lineno: int
|
|
colno: int
|
|
@overload
|
|
def __init__(self, msg: str, doc: str, pos: int) -> None: ...
|
|
@overload
|
|
@deprecated("Deprecated since Python 3.14. Set the 'msg', 'doc' and 'pos' arguments only.")
|
|
def __init__(self, msg: str | type = ..., doc: str | type = ..., pos: int | type = ..., *args: Any) -> None: ...
|
|
|
|
else:
|
|
class TOMLDecodeError(ValueError): ...
|
|
|
|
def load(fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ...
|
|
def loads(s: str, /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ...
|