Skip to content
Merged
8 changes: 4 additions & 4 deletions stdlib/@tests/stubtest_allowlists/darwin-py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
_pyrepl.fancy_termios
_pyrepl.unix_console
_pyrepl.unix_eventqueue
(_socket.SO_BINDTODEVICE)?
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
mmap.MS_ASYNC
mmap.MS_INVALIDATE
mmap.MS_SYNC
mmap.mmap.madvise
mmap.mmap.resize
os.NODEV
os.__all__
posix.NODEV
Expand All @@ -23,5 +22,6 @@ profiling.sampling.live_collector.display
profiling.sampling.live_collector.trend_tracker
profiling.sampling.live_collector.widgets
readline.get_pre_input_hook
resource.RLIM_SAVED_CUR
resource.RLIM_SAVED_MAX
(resource.RLIM_SAVED_CUR)?
(resource.RLIM_SAVED_MAX)?
(socket.__all__)?
30 changes: 15 additions & 15 deletions stdlib/@tests/stubtest_allowlists/linux-py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ _socket.CAN_ISOTP_FORCE_RXSTMIN
_socket.CAN_ISOTP_FORCE_TXSTMIN
_socket.CAN_ISOTP_HALF_DUPLEX
_socket.CAN_ISOTP_LISTEN_MODE
_socket.CAN_ISOTP_LL_OPTS
_socket.CAN_ISOTP_OPTS
_socket.CAN_ISOTP_RECV_FC
(_socket.CAN_ISOTP_LL_OPTS)?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these definitely need the ()? magic trick?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I cleaned up a bunch more socket constants that should have been added.

(_socket.CAN_ISOTP_OPTS)?
(_socket.CAN_ISOTP_RECV_FC)?
_socket.CAN_ISOTP_RX_EXT_ADDR
_socket.CAN_ISOTP_RX_PADDING
_socket.CAN_ISOTP_RX_STMIN
(_socket.CAN_ISOTP_RX_STMIN)?
_socket.CAN_ISOTP_SF_BROADCAST
_socket.CAN_ISOTP_TX_PADDING
_socket.CAN_ISOTP_TX_STMIN
(_socket.CAN_ISOTP_TX_STMIN)?
_socket.CAN_ISOTP_WAIT_TX_DONE
_socket.IPV6_HDRINCL
_socket.SOL_CAN_ISOTP
(_socket.SOL_CAN_ISOTP)?
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
mmap.MS_ASYNC
mmap.MS_INVALIDATE
mmap.MS_SYNC
mmap.mmap.madvise
(mmap.mmap.madvise)?
os.AT_NO_AUTOMOUNT
os.AT_STATX_DONT_SYNC
os.AT_STATX_FORCE_SYNC
Expand Down Expand Up @@ -99,8 +99,8 @@ profiling.sampling.live_collector.display
profiling.sampling.live_collector.trend_tracker
profiling.sampling.live_collector.widgets
readline.get_pre_input_hook
resource.RLIM_SAVED_CUR
resource.RLIM_SAVED_MAX
(resource.RLIM_SAVED_CUR)?
(resource.RLIM_SAVED_MAX)?
socket.CAN_ISOTP_CHK_PAD_DATA
socket.CAN_ISOTP_CHK_PAD_LEN
socket.CAN_ISOTP_DEFAULT_EXT_ADDRESS
Expand All @@ -118,16 +118,16 @@ socket.CAN_ISOTP_FORCE_RXSTMIN
socket.CAN_ISOTP_FORCE_TXSTMIN
socket.CAN_ISOTP_HALF_DUPLEX
socket.CAN_ISOTP_LISTEN_MODE
socket.CAN_ISOTP_LL_OPTS
socket.CAN_ISOTP_OPTS
socket.CAN_ISOTP_RECV_FC
(socket.CAN_ISOTP_LL_OPTS)?
(socket.CAN_ISOTP_OPTS)?
(socket.CAN_ISOTP_RECV_FC)?
socket.CAN_ISOTP_RX_EXT_ADDR
socket.CAN_ISOTP_RX_PADDING
socket.CAN_ISOTP_RX_STMIN
(socket.CAN_ISOTP_RX_STMIN)?
socket.CAN_ISOTP_SF_BROADCAST
socket.CAN_ISOTP_TX_PADDING
socket.CAN_ISOTP_TX_STMIN
(socket.CAN_ISOTP_TX_STMIN)?
socket.CAN_ISOTP_WAIT_TX_DONE
socket.IPV6_HDRINCL
socket.SOL_CAN_ISOTP
(socket.SOL_CAN_ISOTP)?
socket.__all__
22 changes: 3 additions & 19 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ _pyrepl.utils
_pyrepl.windows_console
_pyrepl.windows_eventqueue
_sqlite3.SQLITE_KEYWORDS
_ssl.HAS_PSK_TLS13
_ssl._SSLContext.get_groups
_ssl._SSLContext.set_ciphersuites
_ssl._SSLContext.set_client_sigalgs
_ssl._SSLContext.set_groups
_ssl._SSLContext.set_server_sigalgs
_ssl.get_sigalgs
_struct.Struct.pack_into
_struct.pack
_struct.pack_into
Expand Down Expand Up @@ -153,7 +146,6 @@ genericpath.samestat
glob.glob0
glob.glob1
gzip.compress
hashlib.__all__
http.HTTPMethod.description
http.client.HTTPConnection.__init__
http.client.HTTPSConnection.__init__
Expand Down Expand Up @@ -195,10 +187,6 @@ math.fmin
math.isnormal
math.issubnormal
math.signbit
mmap.mmap.find
mmap.mmap.flush
mmap.mmap.rfind
mmap.mmap.set_name
multiprocessing.context.BaseContext.set_forkserver_preload
multiprocessing.forkserver.ForkServer.set_forkserver_preload
multiprocessing.forkserver.main
Expand Down Expand Up @@ -228,7 +216,6 @@ pathlib.PurePath.__vfspath__
pathlib.PurePath.is_reserved
pdb.Pdb.print_stack_entry
pkgutil.resolve_name
platform.java_ver
posixpath.ALL_BUT_LAST
posixpath.__all__
posixpath.basename
Expand Down Expand Up @@ -267,6 +254,9 @@ pydoc.Doc.getdocloc
re.Pattern.prefixmatch
re.__all__
re.prefixmatch
(resource.RLIMIT_NTHR)?
(resource.RLIMIT_THREADS)?
(resource.RLIMIT_UMTXP)?
shelve.BsdDbShelf.__init__
shelve.DbfilenameShelf.__init__
shelve.Shelf.__init__
Expand All @@ -288,12 +278,6 @@ sqlite3.dbapi2.SQLITE_KEYWORDS
sre_compile
sre_constants
sre_parse
ssl.SSLObject.client_sigalg
ssl.SSLObject.group
ssl.SSLObject.server_sigalg
ssl.SSLSocket.client_sigalg
ssl.SSLSocket.group
ssl.SSLSocket.server_sigalg
symtable.symtable
sys.__jit
sys._monitoring
Expand Down
7 changes: 7 additions & 0 deletions stdlib/_socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ if sys.platform == "linux":
CAN_RAW_JOIN_FILTERS: Final[int]
# Availability: Linux >= 2.6.25
CAN_ISOTP: Final[int]
if sys.version_info >= (3, 15):
SOL_CAN_ISOTP: Final[int]
CAN_ISOTP_OPTS: Final[int]
CAN_ISOTP_RECV_FC: Final[int]
CAN_ISOTP_TX_STMIN: Final[int]
CAN_ISOTP_RX_STMIN: Final[int]
CAN_ISOTP_LL_OPTS: Final[int]
# Availability: Linux >= 5.4
CAN_J1939: Final[int]

Expand Down
11 changes: 11 additions & 0 deletions stdlib/_ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ if sys.version_info < (3, 12):
def RAND_status() -> bool: ...
def get_default_verify_paths() -> tuple[str, str, str, str]: ...

if sys.version_info >= (3, 15):
def get_sigalgs() -> list[str]: ...

if sys.platform == "win32":
_EnumRetType: TypeAlias = list[tuple[bytes, str, set[str] | bool]]
def enum_certificates(store_name: str) -> _EnumRetType: ...
Expand Down Expand Up @@ -101,6 +104,12 @@ class _SSLContext:
def set_ciphers(self, cipherlist: str, /) -> None: ...
def set_default_verify_paths(self) -> None: ...
def set_ecdh_curve(self, name: str, /) -> None: ...
if sys.version_info >= (3, 15):
def get_groups(self, /, *, include_aliases: bool = False) -> list[str]: ...
Comment thread
JelleZijlstra marked this conversation as resolved.
Outdated
def set_ciphersuites(self, ciphersuites: str, /) -> None: ...
def set_client_sigalgs(self, sigalgslist: str, /) -> None: ...
def set_groups(self, grouplist: str, /) -> None: ...
def set_server_sigalgs(self, sigalgslist: str, /) -> None: ...
if sys.version_info >= (3, 13):
def set_psk_client_callback(self, callback: Callable[[str | None], tuple[str | None, bytes]] | None) -> None: ...
def set_psk_server_callback(
Expand Down Expand Up @@ -271,6 +280,8 @@ HAS_ECDH: Final[bool]
HAS_NPN: Final[bool]
if sys.version_info >= (3, 13):
HAS_PSK: Final[bool]
if sys.version_info >= (3, 15):
HAS_PSK_TLS13: Final[bool]
HAS_ALPN: Final[bool]
HAS_SSLv2: Final[bool]
HAS_SSLv3: Final[bool]
Expand Down
25 changes: 24 additions & 1 deletion stdlib/hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ from _typeshed import ReadableBuffer
from collections.abc import Callable, Set as AbstractSet
from typing import Protocol, type_check_only

if sys.version_info >= (3, 11):
if sys.version_info >= (3, 15):
__all__ = (
"md5",
"sha1",
Expand All @@ -41,8 +41,31 @@ if sys.version_info >= (3, 11):
"new",
"algorithms_guaranteed",
"algorithms_available",
"file_digest",
"pbkdf2_hmac",
"scrypt",
)
elif sys.version_info >= (3, 11):
__all__ = (
"md5",
"sha1",
"sha224",
"sha256",
"sha384",
"sha512",
"blake2b",
"blake2s",
"sha3_224",
"sha3_256",
"sha3_384",
"sha3_512",
"shake_128",
"shake_256",
"new",
"algorithms_guaranteed",
"algorithms_available",
"file_digest",
"pbkdf2_hmac",
)
else:
__all__ = (
Expand Down
41 changes: 35 additions & 6 deletions stdlib/mmap.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ PAGESIZE: Final[int]
@disjoint_base
class mmap:
if sys.platform == "win32":
def __new__(cls, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> Self: ...
if sys.version_info >= (3, 15):
def __new__(
cls,
fileno: int,
length: int,
tagname: str | None = None,
access: int = 0,
offset: int = 0,
*,
trackfd: bool = True,
) -> Self: ...
else:
def __new__(cls, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> Self: ...
else:
if sys.version_info >= (3, 13):
def __new__(
Expand All @@ -53,11 +65,16 @@ class mmap:
) -> Self: ...

def close(self) -> None: ...
def flush(self, offset: int = 0, size: int = ..., /) -> None: ...
if sys.version_info >= (3, 15):
def flush(self, offset: int = 0, size: int = ..., /, *, flags: int = 0) -> None: ...
else:
def flush(self, offset: int = 0, size: int = ..., /) -> None: ...

def move(self, dest: int, src: int, count: int, /) -> None: ...
def read_byte(self) -> int: ...
def readline(self) -> bytes: ...
def resize(self, newsize: int, /) -> None: ...
if sys.version_info < (3, 15) or sys.platform != "darwin":
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this is correct: python/cpython#138276. It used to be available on all platforms (but it would fail on platforms without MREMAP), now it only exists if it works.

def resize(self, newsize: int, /) -> None: ...
if sys.platform != "win32":
def seek(self, pos: int, whence: Literal[0, 1, 2, 3, 4] = os.SEEK_SET, /) -> None: ...
else:
Expand All @@ -69,12 +86,24 @@ class mmap:
def __len__(self) -> int: ...
closed: bool
if sys.platform != "win32":
def madvise(self, option: int, start: int = 0, length: int = ..., /) -> None: ...
if sys.version_info >= (3, 15):
def madvise(self, option: int, start: int = 0, length: int | None = None, /) -> None: ...
else:
def madvise(self, option: int, start: int = 0, length: int = ..., /) -> None: ...

if sys.version_info >= (3, 15):
def find(self, view: ReadableBuffer, start: int | None = None, end: int | None = None, /) -> int: ...
def rfind(self, view: ReadableBuffer, start: int | None = None, end: int | None = None, /) -> int: ...

else:
def find(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ...
def rfind(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ...

def find(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ...
def rfind(self, view: ReadableBuffer, start: int = ..., end: int = ..., /) -> int: ...
def read(self, n: int | None = None, /) -> bytes: ...
def write(self, bytes: ReadableBuffer, /) -> int: ...
if sys.version_info >= (3, 15):
def set_name(self, name: str, /) -> None: ...

@overload
def __getitem__(self, key: SupportsIndex, /) -> int: ...
@overload
Expand Down
4 changes: 3 additions & 1 deletion stdlib/platform.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def mac_ver(
release: str = "", versioninfo: tuple[str, str, str] = ("", "", ""), machine: str = ""
) -> tuple[str, tuple[str, str, str], str]: ...

if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
pass
elif sys.version_info >= (3, 13):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm on mobile right now, so I can't select multiple rows, but can we fix the version_info check to use the standard format?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it so it's unconditionally @deprecated.

@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def java_ver(
release: str = "",
Expand Down
7 changes: 7 additions & 0 deletions stdlib/resource.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if sys.platform != "win32":
RLIMIT_RSS: Final[int]
RLIMIT_STACK: Final[int]
RLIM_INFINITY: Final[int]
if sys.version_info >= (3, 15):
RLIM_SAVED_CUR: Final[int]
RLIM_SAVED_MAX: Final[int]
RUSAGE_CHILDREN: Final[int]
RUSAGE_SELF: Final[int]
if sys.platform == "linux":
Expand All @@ -25,6 +28,10 @@ if sys.platform != "win32":
RLIMIT_RTTIME: Final[int]
RLIMIT_SIGPENDING: Final[int]
RUSAGE_THREAD: Final[int]
if sys.version_info >= (3, 15):
RLIMIT_NTHR: Final[int]
RLIMIT_UMTXP: Final[int]
RLIMIT_THREADS: Final[int]

@final
class struct_rusage(
Expand Down
18 changes: 18 additions & 0 deletions stdlib/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,24 @@ if sys.platform == "linux":
from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER

__all__ += ["CAN_RAW_ERR_FILTER"]
if sys.version_info >= (3, 15):
from _socket import (
CAN_ISOTP_LL_OPTS as CAN_ISOTP_LL_OPTS,
CAN_ISOTP_OPTS as CAN_ISOTP_OPTS,
CAN_ISOTP_RECV_FC as CAN_ISOTP_RECV_FC,
CAN_ISOTP_RX_STMIN as CAN_ISOTP_RX_STMIN,
CAN_ISOTP_TX_STMIN as CAN_ISOTP_TX_STMIN,
SOL_CAN_ISOTP as SOL_CAN_ISOTP,
)

__all__ += [
"CAN_ISOTP_LL_OPTS",
"CAN_ISOTP_OPTS",
"CAN_ISOTP_RECV_FC",
"CAN_ISOTP_RX_STMIN",
"CAN_ISOTP_TX_STMIN",
"SOL_CAN_ISOTP",
]

if sys.platform == "linux":
from _socket import (
Expand Down
Loading
Loading