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
18 changes: 0 additions & 18 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ concurrent.interpreters._crossinterp.classonly.__isabstractmethod__
concurrent.interpreters._crossinterp.classonly.__set_name__
concurrent.interpreters._crossinterp.classonly.__wrapped__
copy.deepcopy
ctypes.SetPointerType
dataclasses._MISSING_TYPE
dataclasses.MISSING
dataclasses.field
Expand All @@ -90,9 +89,6 @@ genericpath.getmtime
genericpath.getsize
genericpath.samefile
genericpath.samestat
glob.glob0
glob.glob1
gzip.compress
http.HTTPMethod.description
http.client.HTTPConnection.__init__
http.client.HTTPSConnection.__init__
Expand Down Expand Up @@ -124,10 +120,6 @@ io.Writer.write
mailbox.Mailbox.__enter__
mailbox.Mailbox.__exit__
mailbox._ProxyFile.__class_getitem__
marshal.dump
marshal.dumps
multiprocessing.context.BaseContext.set_forkserver_preload
multiprocessing.forkserver.ForkServer.set_forkserver_preload
multiprocessing.managers.BaseListProxy.clear
multiprocessing.managers.BaseListProxy.copy
multiprocessing.managers._BaseDictProxy.__iter__
Expand All @@ -152,8 +144,6 @@ os.path.ALL_BUT_LAST
os.path.__all__
pathlib.PurePath.__vfspath__
pathlib.PurePath.is_reserved
pdb.Pdb.print_stack_entry
pkgutil.resolve_name
posixpath.ALL_BUT_LAST
posixpath.__all__
posixpath.basename
Expand All @@ -165,17 +155,9 @@ posixpath.split
posixpath.splitdrive
posixpath.splitext
posixpath.splitroot
pprint.PrettyPrinter.__init__
pprint.pformat
pprint.pprint
site.addsitedir
site.addsitepackages
site.addusersitepackages
site.process_startup_files
sre_compile
sre_constants
sre_parse
symtable.symtable
sys.__jit
sys._monitoring
sys.last_exc
Expand Down
7 changes: 5 additions & 2 deletions stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_
c_buffer = create_string_buffer

def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...

if sys.version_info < (3, 15):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...

@deprecated("Soft deprecated since Python 3.13. Use multiplication instead.")
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ...

Expand Down
17 changes: 9 additions & 8 deletions stdlib/glob.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ __all__ = ["escape", "glob", "iglob"]
if sys.version_info >= (3, 13):
__all__ += ["translate"]

@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
if sys.version_info < (3, 15):
@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
@deprecated(
"Deprecated since Python 3.10; will be removed in Python 3.15. Use `glob.glob()` with the *root_dir* argument instead."
)
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...

if sys.version_info >= (3, 11):
def glob(
Expand Down
5 changes: 4 additions & 1 deletion stdlib/gzip.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ class GzipFile(BaseStream):
class _GzipReader(DecompressReader):
def __init__(self, fp: _ReadableFileobj) -> None: ...

if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def compress(data: SizedBuffer, compresslevel: int = 6, *, mtime: float = 0) -> bytes: ...

elif sys.version_info >= (3, 14):
def compress(data: SizedBuffer, compresslevel: int = 9, *, mtime: float = 0) -> bytes: ...

else:
Expand Down
6 changes: 5 additions & 1 deletion stdlib/marshal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ _Marshallable: TypeAlias = (
| ReadableBuffer
)

if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 6, /, *, allow_code: bool = True) -> None: ...
def dumps(value: _Marshallable, version: int = 6, /, *, allow_code: bool = True) -> bytes: ...

elif sys.version_info >= (3, 14):
def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 5, /, *, allow_code: bool = True) -> None: ...
def dumps(value: _Marshallable, version: int = 5, /, *, allow_code: bool = True) -> bytes: ...

Expand Down
8 changes: 7 additions & 1 deletion stdlib/multiprocessing/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ class BaseContext:
def log_to_stderr(self, level: _LoggingLevel | None = None) -> Logger: ...
def allow_connection_pickling(self) -> None: ...
def set_executable(self, executable: str) -> None: ...
def set_forkserver_preload(self, module_names: list[str]) -> None: ...
if sys.version_info >= (3, 15):
def set_forkserver_preload(
self, module_names: list[str], *, on_error: Literal["ignore", "warn", "fail"] = "ignore"
) -> None: ...
else:
def set_forkserver_preload(self, module_names: list[str]) -> None: ...

@overload
def get_context(self, method: None = None) -> DefaultContext: ...
@overload
Expand Down
10 changes: 8 additions & 2 deletions stdlib/multiprocessing/forkserver.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ import sys
from _typeshed import FileDescriptorLike, Unused
from collections.abc import Sequence
from struct import Struct
from typing import Any, Final
from typing import Any, Final, Literal

__all__ = ["ensure_running", "get_inherited_fds", "connect_to_new_process", "set_forkserver_preload"]

MAXFDS_TO_SEND: Final = 256
SIGNED_STRUCT: Final[Struct]

class ForkServer:
def set_forkserver_preload(self, modules_names: list[str]) -> None: ...
if sys.version_info >= (3, 15):
def set_forkserver_preload(
self, modules_names: list[str], *, on_error: Literal["ignore", "warn", "fail"] = "ignore"
) -> None: ...
else:
def set_forkserver_preload(self, modules_names: list[str]) -> None: ...

def get_inherited_fds(self) -> list[int] | None: ...
def connect_to_new_process(self, fds: Sequence[int]) -> tuple[int, int]: ...
def ensure_running(self) -> None: ...
Expand Down
6 changes: 5 additions & 1 deletion stdlib/pdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ class Pdb(Bdb, Cmd):
else:
def print_stack_trace(self) -> None: ...

def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = "\n-> ") -> None: ...
if sys.version_info >= (3, 15):
def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str | None = None) -> None: ...
else:
def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = "\n-> ") -> None: ...

def lookupmodule(self, filename: str) -> str | None: ...
if sys.version_info < (3, 11):
def _runscript(self, filename: str) -> None: ...
Expand Down
7 changes: 6 additions & 1 deletion stdlib/pkgutil.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ def walk_packages(
path: Iterable[StrOrBytesPath] | None = None, prefix: str = "", onerror: Callable[[str], object] | None = None
) -> Iterator[ModuleInfo]: ...
def get_data(package: str, resource: str) -> bytes | None: ...
def resolve_name(name: str) -> Any: ...

if sys.version_info >= (3, 15):
def resolve_name(name: str, *, strict: bool = False) -> Any: ...

else:
def resolve_name(name: str) -> Any: ...
135 changes: 97 additions & 38 deletions stdlib/pprint.pyi
Original file line number Diff line number Diff line change
@@ -1,57 +1,116 @@
import sys
from _typeshed import SupportsWrite
from collections import deque
from typing import IO

__all__ = ["pprint", "pformat", "isreadable", "isrecursive", "saferepr", "PrettyPrinter", "pp"]

def pformat(
object: object,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> str: ...
def pp(
object: object,
stream: IO[str] | None = None,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = False,
underscore_numbers: bool = False,
) -> None: ...
def pprint(
object: object,
stream: IO[str] | None = None,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> None: ...
def isreadable(object: object) -> bool: ...
def isrecursive(object: object) -> bool: ...
def saferepr(object: object) -> str: ...
if sys.version_info >= (3, 15):
def pformat(
object: object,
indent: int = 4,
width: int = 88,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> str: ...

class PrettyPrinter:
def __init__(
self,
else:
def pformat(
object: object,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> str: ...

if sys.version_info >= (3, 15):
def pp(
object: object,
stream: IO[str] | None = None,
indent: int = 4,
width: int = 88,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = False,
underscore_numbers: bool = False,
) -> None: ...

else:
def pp(
object: object,
stream: IO[str] | None = None,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = False,
underscore_numbers: bool = False,
) -> None: ...

if sys.version_info >= (3, 15):
def pprint(
object: object,
stream: IO[str] | None = None,
indent: int = 4,
width: int = 88,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> None: ...

else:
def pprint(
object: object,
stream: IO[str] | None = None,
indent: int = 1,
width: int = 80,
depth: int | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> None: ...

def isreadable(object: object) -> bool: ...
def isrecursive(object: object) -> bool: ...
def saferepr(object: object) -> str: ...

class PrettyPrinter:
if sys.version_info >= (3, 15):
def __init__(
self,
indent: int = 4,
width: int = 88,
depth: int | None = None,
stream: IO[str] | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> None: ...
else:
def __init__(
self,
indent: int = 1,
width: int = 80,
depth: int | None = None,
stream: IO[str] | None = None,
*,
compact: bool = False,
sort_dicts: bool = True,
underscore_numbers: bool = False,
) -> None: ...

def pformat(self, object: object) -> str: ...
def pprint(self, object: object) -> None: ...
def isreadable(self, object: object) -> bool: ...
Expand Down
21 changes: 18 additions & 3 deletions stdlib/site.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,24 @@ USER_BASE: str | None
def main() -> None: ...
def abs_paths() -> None: ... # undocumented
def addpackage(sitedir: StrPath, name: StrPath, known_paths: set[str] | None) -> set[str] | None: ... # undocumented
def addsitedir(sitedir: str, known_paths: set[str] | None = None) -> None: ...
def addsitepackages(known_paths: set[str] | None, prefixes: Iterable[str] | None = None) -> set[str] | None: ... # undocumented
def addusersitepackages(known_paths: set[str] | None) -> set[str] | None: ... # undocumented

if sys.version_info >= (3, 15):
def process_startup_files() -> None: ... # undocumented
def addsitedir(sitedir: str, known_paths: set[str] | None = None, *, defer_processing_start_files: bool = False) -> None: ...
def addsitepackages(
known_paths: set[str] | None, prefixes: Iterable[str] | None = None, *, defer_processing_start_files: bool = False
) -> set[str] | None: ... # undocumented
def addusersitepackages(
known_paths: set[str] | None, *, defer_processing_start_files: bool = False
) -> set[str] | None: ... # undocumented

else:
def addsitedir(sitedir: str, known_paths: set[str] | None = None) -> None: ...
def addsitepackages(
known_paths: set[str] | None, prefixes: Iterable[str] | None = None
) -> set[str] | None: ... # undocumented
def addusersitepackages(known_paths: set[str] | None) -> set[str] | None: ... # undocumented

def check_enableusersite() -> bool | None: ... # undocumented

if sys.version_info >= (3, 13):
Expand Down
6 changes: 5 additions & 1 deletion stdlib/symtable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ __all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]
if sys.version_info >= (3, 13):
__all__ += ["SymbolTableType"]

def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...
if sys.version_info >= (3, 15):
def symtable(code: str, filename: str, compile_type: str, *, module: str | None = None) -> SymbolTable: ...

else:
def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...

if sys.version_info >= (3, 13):
from enum import StrEnum
Expand Down
Loading