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
13 changes: 0 additions & 13 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ _frozen_importlib_external._LoaderBasics.load_module
_frozen_importlib_external.cache_from_source
_interpqueues.create
_interpqueues.put
_json.make_scanner.array_hook
_json.scanstring
_pyrepl.base_eventqueue
_pyrepl.commands
_pyrepl.completing_reader
Expand All @@ -38,7 +36,6 @@ _pyrepl.types
_pyrepl.utils
_pyrepl.windows_console
_pyrepl.windows_eventqueue
_sqlite3.SQLITE_KEYWORDS
_ssl.HAS_PSK_TLS13
_ssl._SSLContext.get_groups
_ssl._SSLContext.set_ciphersuites
Expand Down Expand Up @@ -182,9 +179,6 @@ io.Reader.__class_getitem__
io.Reader.read
io.Writer.__class_getitem__
io.Writer.write
json.decoder.JSONDecoder.__init__
json.load
json.loads
mailbox.Mailbox.__enter__
mailbox.Mailbox.__exit__
mailbox._ProxyFile.__class_getitem__
Expand Down Expand Up @@ -278,13 +272,6 @@ site.addsitedir
site.addsitepackages
site.addusersitepackages
site.process_startup_files
sqlite3.Connection.create_aggregate
sqlite3.Connection.create_function
sqlite3.Connection.set_authorizer
sqlite3.Connection.set_progress_handler
sqlite3.Connection.set_trace_callback
sqlite3.SQLITE_KEYWORDS
sqlite3.dbapi2.SQLITE_KEYWORDS
sre_compile
sre_constants
sre_parse
Expand Down
10 changes: 9 additions & 1 deletion stdlib/_json.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from collections.abc import Callable
from typing import Any, final
from typing_extensions import Self
Expand Down Expand Up @@ -36,6 +37,8 @@ class make_encoder:

@final
class make_scanner:
if sys.version_info >= (3, 15):
array_hook: Any
object_hook: Any
object_pairs_hook: Any
parse_int: Any
Expand All @@ -48,4 +51,9 @@ class make_scanner:

def encode_basestring(s: str, /) -> str: ...
def encode_basestring_ascii(s: str, /) -> str: ...
def scanstring(string: str, end: int, strict: bool = True) -> tuple[str, int]: ...

if sys.version_info >= (3, 15):
def scanstring(pystr: str, end: int, strict: bool = True, /) -> tuple[str, int]: ...

else:
def scanstring(string: str, end: int, strict: bool = True) -> tuple[str, int]: ...
2 changes: 2 additions & 0 deletions stdlib/_sqlite3.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ SQLITE_SAVEPOINT: Final = 32
SQLITE_SELECT: Final = 21
SQLITE_TRANSACTION: Final = 22
SQLITE_UPDATE: Final = 23
if sys.version_info >= (3, 15):
SQLITE_KEYWORDS: tuple[str, ...]
adapters: dict[tuple[type[Any], type[Any]], _Adapter[Any]]
converters: dict[str, _Converter]
sqlite_version: str
Expand Down
74 changes: 52 additions & 22 deletions stdlib/json/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from _typeshed import SupportsRead, SupportsWrite
from collections.abc import Callable
from typing import Any, Literal
Expand Down Expand Up @@ -36,28 +37,57 @@ def dump(
sort_keys: bool = False,
**kwds: Any,
) -> None: ...
def loads(
s: str | bytes | bytearray,
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...
def load(
fp: SupportsRead[str | bytes],
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...

if sys.version_info >= (3, 15):
def loads(
s: str | bytes | bytearray,
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
array_hook: Callable[[list[Any]], Any] | None = None,
**kwds: Any,
) -> Any: ...
def load(
fp: SupportsRead[str | bytes],
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
array_hook: Callable[[list[Any]], Any] | None = None,
**kwds: Any,
) -> Any: ...

else:
def loads(
s: str | bytes | bytearray,
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...
def load(
fp: SupportsRead[str | bytes],
*,
cls: type[JSONDecoder] | None = None,
object_hook: Callable[[dict[Any, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None,
**kwds: Any,
) -> Any: ...

def detect_encoding(
b: bytes | bytearray,
) -> Literal["utf-8", "utf-8-sig", "utf-16", "utf-16-be", "utf-16-le", "utf-32", "utf-32-be", "utf-32-le"]: ... # undocumented
38 changes: 28 additions & 10 deletions stdlib/json/decoder.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from collections.abc import Callable
from typing import Any

Expand All @@ -12,21 +13,38 @@ class JSONDecodeError(ValueError):
def __init__(self, msg: str, doc: str, pos: int) -> None: ...

class JSONDecoder:
if sys.version_info >= (3, 15):
array_hook: Callable[[list[Any]], Any] | None
object_hook: Callable[[dict[str, Any]], Any]
parse_float: Callable[[str], Any]
parse_int: Callable[[str], Any]
parse_constant: Callable[[str], Any]
strict: bool
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any]
def __init__(
self,
*,
object_hook: Callable[[dict[str, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
strict: bool = True,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None,
) -> None: ...
if sys.version_info >= (3, 15):
def __init__(
self,
*,
object_hook: Callable[[dict[str, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
strict: bool = True,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None,
array_hook: Callable[[list[Any]], Any] | None = None,
) -> None: ...

else:
def __init__(
self,
*,
object_hook: Callable[[dict[str, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
strict: bool = True,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None,
) -> None: ...

def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented
def raw_decode(self, s: str, idx: int = 0) -> tuple[Any, int]: ...
37 changes: 28 additions & 9 deletions stdlib/sqlite3/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ from typing_extensions import Self, disjoint_base
if sys.version_info < (3, 14):
from sqlite3.dbapi2 import version_info as version_info

if sys.version_info >= (3, 15):
from sqlite3.dbapi2 import SQLITE_KEYWORDS as SQLITE_KEYWORDS

if sys.version_info >= (3, 12):
from sqlite3.dbapi2 import (
LEGACY_TRANSACTION_CONTROL as LEGACY_TRANSACTION_CONTROL,
Expand Down Expand Up @@ -331,7 +334,10 @@ class Connection:
def blobopen(self, table: str, column: str, row: int, /, *, readonly: bool = False, name: str = "main") -> Blob: ...

def commit(self) -> None: ...
def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ...
if sys.version_info >= (3, 15):
def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol], /) -> None: ...
else:
def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ...
if sys.version_info >= (3, 11):
# num_params determines how many params will be passed to the aggregate class. We provide an overload
# for the case where num_params = 1, which is expected to be the common case.
Expand All @@ -350,9 +356,15 @@ class Connection:
) -> None: ...

def create_collation(self, name: str, callback: Callable[[str, str], SupportsIndex] | None, /) -> None: ...
def create_function(
self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = False
) -> None: ...
if sys.version_info >= (3, 15):
def create_function(
self, name: str, narg: int, func: Callable[..., _SqliteData] | None, /, *, deterministic: bool = False
) -> None: ...
else:
def create_function(
self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = False
) -> None: ...

@overload
def cursor(self, factory: None = None) -> Cursor: ...
@overload
Expand All @@ -367,11 +379,18 @@ class Connection:
def iterdump(self) -> Generator[str]: ...

def rollback(self) -> None: ...
def set_authorizer(
self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None
) -> None: ...
def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None: ...
def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ...
if sys.version_info >= (3, 15):
def set_authorizer(
self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None, /
) -> None: ...
def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, /, n: int) -> None: ...
def set_trace_callback(self, trace_callback: Callable[[str], object] | None, /) -> None: ...
else:
def set_authorizer(
self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None
) -> None: ...
def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None: ...
def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ...
# enable_load_extension and load_extension is not available on python distributions compiled
# without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1
def enable_load_extension(self, enable: bool, /) -> None: ...
Expand Down
3 changes: 3 additions & 0 deletions stdlib/sqlite3/dbapi2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ if sys.version_info >= (3, 12):
SQLITE_DBCONFIG_WRITABLE_SCHEMA as SQLITE_DBCONFIG_WRITABLE_SCHEMA,
)

if sys.version_info >= (3, 15):
from _sqlite3 import SQLITE_KEYWORDS as SQLITE_KEYWORDS

if sys.version_info >= (3, 11):
from _sqlite3 import (
SQLITE_ABORT as SQLITE_ABORT,
Expand Down
Loading