Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ tarfile.TarFile.zstopen
threading.Thread.__init__
threading._RLock.locked
tkinter.Event.__class_getitem__
tomllib.TOMLDecodeError.__init__
turtle.__all__
turtle.RawTurtle.fill
turtle.RawTurtle.poly
Expand Down
20 changes: 18 additions & 2 deletions stdlib/tomllib.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import sys
from _typeshed import SupportsRead
from collections.abc import Callable
from typing import Any
from typing import Any, overload
from typing_extensions import deprecated

__all__ = ("loads", "load", "TOMLDecodeError")

class TOMLDecodeError(ValueError): ...
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 in Python 3.14; Please set '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]: ...