@@ -4,18 +4,30 @@ from _typeshed.importlib import MetaPathFinderProtocol, PathEntryFinderProtocol
44from builtins import object as _object
55from collections .abc import AsyncGenerator , Callable , Sequence
66from io import TextIOWrapper
7- from types import FrameType , ModuleType , TracebackType
7+ from types import FrameType , ModuleType , SimpleNamespace , TracebackType
88from typing import Any , Final , Literal , NoReturn , Protocol , TextIO , TypeAlias , TypeVar , final , overload , type_check_only
99from typing_extensions import LiteralString , deprecated
1010
1111_T = TypeVar ("_T" )
12+ _LazyImportMode : TypeAlias = Literal ["normal" , "all" , "none" ]
13+ _LazyImportFilter : TypeAlias = Callable [[str , str , tuple [str , ...] | None ], bool ]
1214
1315# see https://github.com/python/typeshed/issues/8513#issue-1333671093 for the rationale behind this alias
1416_ExitCode : TypeAlias = str | int | None
1517
18+ if sys .version_info >= (3 , 15 ):
19+ @type_check_only
20+ class _AbiInfo (SimpleNamespace ):
21+ pointer_bits : int
22+ free_threaded : bool
23+ debug : bool
24+ byteorder : Literal ["little" , "big" ]
25+
1626# ----- sys variables -----
1727if sys .platform != "win32" :
1828 abiflags : str
29+ if sys .version_info >= (3 , 15 ):
30+ abi_info : _AbiInfo
1931argv : list [str ]
2032base_exec_prefix : str
2133base_prefix : str
@@ -40,6 +52,8 @@ maxsize: int
4052maxunicode : int
4153meta_path : list [MetaPathFinderProtocol ]
4254modules : dict [str , ModuleType ]
55+ if sys .version_info >= (3 , 15 ):
56+ lazy_modules : dict [str , set [str ]]
4357orig_argv : list [str ]
4458path : list [str ]
4559path_hooks : list [Callable [[str ], PathEntryFinderProtocol ]]
@@ -376,6 +390,11 @@ if sys.platform != "win32":
376390
377391def getfilesystemencoding () -> LiteralString : ...
378392def getfilesystemencodeerrors () -> LiteralString : ...
393+
394+ if sys .version_info >= (3 , 15 ):
395+ def get_lazy_imports () -> _LazyImportMode : ...
396+ def get_lazy_imports_filter () -> _LazyImportFilter | None : ...
397+
379398def getrefcount (object : Any , / ) -> int : ...
380399def getrecursionlimit () -> int : ...
381400def getsizeof (obj : object , default : int = ...) -> int : ...
@@ -486,6 +505,10 @@ def set_coroutine_origin_tracking_depth(depth: int) -> None: ...
486505def set_int_max_str_digits (maxdigits : int ) -> None : ...
487506def get_int_max_str_digits () -> int : ...
488507
508+ if sys .version_info >= (3 , 15 ):
509+ def set_lazy_imports (mode : _LazyImportMode ) -> None : ...
510+ def set_lazy_imports_filter (filter : _LazyImportFilter | None ) -> None : ...
511+
489512if sys .version_info >= (3 , 12 ):
490513 if sys .version_info >= (3 , 13 ):
491514 def getunicodeinternedsize (* , _only_immortal : bool = False ) -> int : ...
0 commit comments