11import types
22from collections .abc import Callable
3- from typing import Any , Final , Literal , SupportsIndex , TypeVar
3+ from typing import Any , Final , Literal , SupportsIndex , TypeVar , overload
44from typing_extensions import TypeAlias
55
66_R = TypeVar ("_R" )
@@ -18,42 +18,38 @@ class CrossInterpreterBufferView:
1818def new_config (name : _Configs = "isolated" , / , ** overides : object ) -> types .SimpleNamespace : ...
1919def create (config : types .SimpleNamespace | _Configs | None = "isolated" , * , reqrefs : bool = False ) -> int : ...
2020def destroy (id : SupportsIndex , * , restrict : bool = False ) -> None : ...
21- def list_all (* , require_ready : bool ) -> list [tuple [int , int ]]: ...
22- def get_current () -> tuple [int , int ]: ...
23- def get_main () -> tuple [int , int ]: ...
21+ def list_all (* , require_ready : bool = False ) -> list [tuple [int , _Whence ]]: ...
22+ def get_current () -> tuple [int , _Whence ]: ...
23+ def get_main () -> tuple [int , _Whence ]: ...
2424def is_running (id : SupportsIndex , * , restrict : bool = False ) -> bool : ...
2525def get_config (id : SupportsIndex , * , restrict : bool = False ) -> types .SimpleNamespace : ...
2626def whence (id : SupportsIndex ) -> _Whence : ...
2727def exec (
28- id : SupportsIndex ,
29- code : str | types .CodeType | Callable [[], object ],
30- shared : _SharedDict | None = None ,
31- * ,
32- restrict : bool = False ,
28+ id : SupportsIndex , code : str | types .CodeType | Callable [[], object ], shared : _SharedDict = {}, * , restrict : bool = False
3329) -> None | types .SimpleNamespace : ...
3430def call (
3531 id : SupportsIndex ,
3632 callable : Callable [..., _R ],
37- args : tuple [Any , ...] | None = None ,
38- kwargs : dict [str , Any ] | None = None ,
33+ args : tuple [Any , ...] = () ,
34+ kwargs : dict [str , Any ] = {} ,
3935 * ,
36+ preserve_exc : bool = False ,
4037 restrict : bool = False ,
4138) -> tuple [_R , types .SimpleNamespace ]: ...
4239def run_string (
43- id : SupportsIndex ,
44- script : str | types .CodeType | Callable [[], object ],
45- shared : _SharedDict | None = None ,
46- * ,
47- restrict : bool = False ,
40+ id : SupportsIndex , script : str | types .CodeType | Callable [[], object ], shared : _SharedDict = {}, * , restrict : bool = False
4841) -> None : ...
4942def run_func (
50- id : SupportsIndex , func : types .CodeType | Callable [[], object ], shared : _SharedDict | None = None , * , restrict : bool = False
43+ id : SupportsIndex , func : types .CodeType | Callable [[], object ], shared : _SharedDict = {} , * , restrict : bool = False
5144) -> None : ...
5245def set___main___attrs (id : SupportsIndex , updates : _SharedDict , * , restrict : bool = False ) -> None : ...
5346def incref (id : SupportsIndex , * , implieslink : bool = False , restrict : bool = False ) -> None : ...
5447def decref (id : SupportsIndex , * , restrict : bool = False ) -> None : ...
5548def is_shareable (obj : object ) -> bool : ...
56- def capture_exception (exc : BaseException | None = None ) -> types .SimpleNamespace : ...
49+ @overload
50+ def capture_exception (exc : BaseException ) -> types .SimpleNamespace : ...
51+ @overload
52+ def capture_exception (exc : None = None ) -> types .SimpleNamespace | None : ...
5753
5854_Whence : TypeAlias = Literal [0 , 1 , 2 , 3 , 4 , 5 ]
5955WHENCE_UNKNOWN : Final = 0
0 commit comments