| 1 |
import signal |
| 2 |
import sys |
| 3 |
from bdb import Bdb, _Backend |
| 4 |
from cmd import Cmd |
| 5 |
from collections.abc import Callable, Iterable, Mapping, Sequence |
| 6 |
from inspect import _SourceObjectType |
| 7 |
from linecache import _ModuleGlobals |
| 8 |
from rlcompleter import Completer |
| 9 |
from types import CodeType, FrameType, TracebackType |
| 10 |
from typing import IO, Any, ClassVar, Final, Literal, TypeVar |
| 11 |
from typing_extensions import ParamSpec, Self, TypeAlias, deprecated |
| 12 |
|
| 13 |
__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"] |
| 14 |
if sys.version_info >= (3, 14): |
| 15 |
__all__ += ["set_default_backend", "get_default_backend"] |
| 16 |
|
| 17 |
_T = TypeVar("_T") |
| 18 |
_P = ParamSpec("_P") |
| 19 |
_Mode: TypeAlias = Literal["inline", "cli"] |
| 20 |
|
| 21 |
line_prefix: Final[str] |
| 22 |
|
| 23 |
class Restart(Exception): ... |
| 24 |
|
| 25 |
def run(statement: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... |
| 26 |
def runeval(expression: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> Any: ... |
| 27 |
def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ... |
| 28 |
def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... |
| 29 |
|
| 30 |
if sys.version_info >= (3, 14): |
| 31 |
def set_default_backend(backend: _Backend) -> None: ... |
| 32 |
def get_default_backend() -> _Backend: ... |
| 33 |
def set_trace(*, header: str | None = None, commands: Iterable[str] | None = None) -> None: ... |
| 34 |
async def set_trace_async(*, header: str | None = None, commands: Iterable[str] | None = None) -> None: ... |
| 35 |
|
| 36 |
else: |
| 37 |
def set_trace(*, header: str | None = None) -> None: ... |
| 38 |
|
| 39 |
def post_mortem(t: TracebackType | None = None) -> None: ... |
| 40 |
def pm() -> None: ... |
| 41 |
|
| 42 |
class Pdb(Bdb, Cmd): |
| 43 |
|
| 44 |
|
| 45 |
commands_resuming: ClassVar[list[str]] |
| 46 |
|
| 47 |
if sys.version_info >= (3, 13): |
| 48 |
MAX_CHAINED_EXCEPTION_DEPTH: Final = 999 |
| 49 |
|
| 50 |
aliases: dict[str, str] |
| 51 |
mainpyfile: str |
| 52 |
_wait_for_mainpyfile: bool |
| 53 |
rcLines: list[str] |
| 54 |
commands: dict[int, list[str]] |
| 55 |
commands_doprompt: dict[int, bool] |
| 56 |
commands_silent: dict[int, bool] |
| 57 |
commands_defining: bool |
| 58 |
commands_bnum: int | None |
| 59 |
lineno: int | None |
| 60 |
stack: list[tuple[FrameType, int]] |
| 61 |
curindex: int |
| 62 |
curframe: FrameType | None |
| 63 |
if sys.version_info >= (3, 13): |
| 64 |
@property |
| 65 |
@deprecated("The frame locals reference is no longer cached. Use 'curframe.f_locals' instead.") |
| 66 |
def curframe_locals(self) -> Mapping[str, Any]: ... |
| 67 |
@curframe_locals.setter |
| 68 |
@deprecated( |
| 69 |
"Setting 'curframe_locals' no longer has any effect as of 3.14. Update the contents of 'curframe.f_locals' instead." |
| 70 |
) |
| 71 |
def curframe_locals(self, value: Mapping[str, Any]) -> None: ... |
| 72 |
else: |
| 73 |
curframe_locals: Mapping[str, Any] |
| 74 |
if sys.version_info >= (3, 14): |
| 75 |
mode: _Mode | None |
| 76 |
colorize: bool |
| 77 |
def __init__( |
| 78 |
self, |
| 79 |
completekey: str = "tab", |
| 80 |
stdin: IO[str] | None = None, |
| 81 |
stdout: IO[str] | None = None, |
| 82 |
skip: Iterable[str] | None = None, |
| 83 |
nosigint: bool = False, |
| 84 |
readrc: bool = True, |
| 85 |
mode: _Mode | None = None, |
| 86 |
backend: _Backend | None = None, |
| 87 |
colorize: bool = False, |
| 88 |
) -> None: ... |
| 89 |
else: |
| 90 |
def __init__( |
| 91 |
self, |
| 92 |
completekey: str = "tab", |
| 93 |
stdin: IO[str] | None = None, |
| 94 |
stdout: IO[str] | None = None, |
| 95 |
skip: Iterable[str] | None = None, |
| 96 |
nosigint: bool = False, |
| 97 |
readrc: bool = True, |
| 98 |
) -> None: ... |
| 99 |
if sys.version_info >= (3, 14): |
| 100 |
def set_trace(self, frame: FrameType | None = None, *, commands: Iterable[str] | None = None) -> None: ... |
| 101 |
async def set_trace_async(self, frame: FrameType | None = None, *, commands: Iterable[str] | None = None) -> None: ... |
| 102 |
|
| 103 |
def forget(self) -> None: ... |
| 104 |
def setup(self, f: FrameType | None, tb: TracebackType | None) -> None: ... |
| 105 |
if sys.version_info < (3, 11): |
| 106 |
def execRcLines(self) -> None: ... |
| 107 |
|
| 108 |
if sys.version_info >= (3, 13): |
| 109 |
user_opcode = Bdb.user_line |
| 110 |
|
| 111 |
def bp_commands(self, frame: FrameType) -> bool: ... |
| 112 |
|
| 113 |
if sys.version_info >= (3, 13): |
| 114 |
def interaction(self, frame: FrameType | None, tb_or_exc: TracebackType | BaseException | None) -> None: ... |
| 115 |
else: |
| 116 |
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ... |
| 117 |
|
| 118 |
def displayhook(self, obj: object) -> None: ... |
| 119 |
def handle_command_def(self, line: str) -> bool: ... |
| 120 |
def defaultFile(self) -> str: ... |
| 121 |
def lineinfo(self, identifier: str) -> tuple[None, None, None] | tuple[str, str, int]: ... |
| 122 |
if sys.version_info >= (3, 14): |
| 123 |
def checkline(self, filename: str, lineno: int, module_globals: _ModuleGlobals | None = None) -> int: ... |
| 124 |
else: |
| 125 |
def checkline(self, filename: str, lineno: int) -> int: ... |
| 126 |
|
| 127 |
def _getval(self, arg: str) -> object: ... |
| 128 |
if sys.version_info >= (3, 14): |
| 129 |
def print_stack_trace(self, count: int | None = None) -> None: ... |
| 130 |
else: |
| 131 |
def print_stack_trace(self) -> None: ... |
| 132 |
|
| 133 |
def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = "\n-> ") -> None: ... |
| 134 |
def lookupmodule(self, filename: str) -> str | None: ... |
| 135 |
if sys.version_info < (3, 11): |
| 136 |
def _runscript(self, filename: str) -> None: ... |
| 137 |
|
| 138 |
if sys.version_info >= (3, 14): |
| 139 |
def complete_multiline_names(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 140 |
|
| 141 |
if sys.version_info >= (3, 13): |
| 142 |
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 143 |
|
| 144 |
def do_commands(self, arg: str) -> bool | None: ... |
| 145 |
if sys.version_info >= (3, 14): |
| 146 |
def do_break(self, arg: str, temporary: bool = False) -> bool | None: ... |
| 147 |
else: |
| 148 |
def do_break(self, arg: str, temporary: bool | Literal[0, 1] = 0) -> bool | None: ... |
| 149 |
|
| 150 |
def do_tbreak(self, arg: str) -> bool | None: ... |
| 151 |
def do_enable(self, arg: str) -> bool | None: ... |
| 152 |
def do_disable(self, arg: str) -> bool | None: ... |
| 153 |
def do_condition(self, arg: str) -> bool | None: ... |
| 154 |
def do_ignore(self, arg: str) -> bool | None: ... |
| 155 |
def do_clear(self, arg: str) -> bool | None: ... |
| 156 |
def do_where(self, arg: str) -> bool | None: ... |
| 157 |
if sys.version_info >= (3, 13): |
| 158 |
def do_exceptions(self, arg: str) -> bool | None: ... |
| 159 |
|
| 160 |
def do_up(self, arg: str) -> bool | None: ... |
| 161 |
def do_down(self, arg: str) -> bool | None: ... |
| 162 |
def do_until(self, arg: str) -> bool | None: ... |
| 163 |
def do_step(self, arg: str) -> bool | None: ... |
| 164 |
def do_next(self, arg: str) -> bool | None: ... |
| 165 |
def do_run(self, arg: str) -> bool | None: ... |
| 166 |
def do_return(self, arg: str) -> bool | None: ... |
| 167 |
def do_continue(self, arg: str) -> bool | None: ... |
| 168 |
def do_jump(self, arg: str) -> bool | None: ... |
| 169 |
def do_debug(self, arg: str) -> bool | None: ... |
| 170 |
def do_quit(self, arg: str) -> bool | None: ... |
| 171 |
def do_EOF(self, arg: str) -> bool | None: ... |
| 172 |
def do_args(self, arg: str) -> bool | None: ... |
| 173 |
def do_retval(self, arg: str) -> bool | None: ... |
| 174 |
def do_p(self, arg: str) -> bool | None: ... |
| 175 |
def do_pp(self, arg: str) -> bool | None: ... |
| 176 |
def do_list(self, arg: str) -> bool | None: ... |
| 177 |
def do_whatis(self, arg: str) -> bool | None: ... |
| 178 |
def do_alias(self, arg: str) -> bool | None: ... |
| 179 |
def do_unalias(self, arg: str) -> bool | None: ... |
| 180 |
def do_help(self, arg: str) -> bool | None: ... |
| 181 |
do_b = do_break |
| 182 |
do_cl = do_clear |
| 183 |
do_w = do_where |
| 184 |
do_bt = do_where |
| 185 |
do_u = do_up |
| 186 |
do_d = do_down |
| 187 |
do_unt = do_until |
| 188 |
do_s = do_step |
| 189 |
do_n = do_next |
| 190 |
do_restart = do_run |
| 191 |
do_r = do_return |
| 192 |
do_c = do_continue |
| 193 |
do_cont = do_continue |
| 194 |
do_j = do_jump |
| 195 |
do_q = do_quit |
| 196 |
do_exit = do_quit |
| 197 |
do_a = do_args |
| 198 |
do_rv = do_retval |
| 199 |
do_l = do_list |
| 200 |
do_h = do_help |
| 201 |
def help_exec(self) -> None: ... |
| 202 |
def help_pdb(self) -> None: ... |
| 203 |
def sigint_handler(self, signum: signal.Signals, frame: FrameType) -> None: ... |
| 204 |
if sys.version_info >= (3, 13): |
| 205 |
def message(self, msg: str, end: str = "\n") -> None: ... |
| 206 |
else: |
| 207 |
def message(self, msg: str) -> None: ... |
| 208 |
|
| 209 |
def error(self, msg: str) -> None: ... |
| 210 |
if sys.version_info >= (3, 13): |
| 211 |
def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 212 |
if sys.version_info >= (3, 12): |
| 213 |
def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ... |
| 214 |
if sys.version_info >= (3, 13): |
| 215 |
|
| 216 |
@property |
| 217 |
def rlcompleter(self) -> type[Completer]: ... |
| 218 |
|
| 219 |
def _select_frame(self, number: int) -> None: ... |
| 220 |
def _getval_except(self, arg: str, frame: FrameType | None = None) -> object: ... |
| 221 |
def _print_lines( |
| 222 |
self, lines: Sequence[str], start: int, breaks: Sequence[int] = (), frame: FrameType | None = None |
| 223 |
) -> None: ... |
| 224 |
def _cmdloop(self) -> None: ... |
| 225 |
def do_display(self, arg: str) -> bool | None: ... |
| 226 |
def do_interact(self, arg: str) -> bool | None: ... |
| 227 |
def do_longlist(self, arg: str) -> bool | None: ... |
| 228 |
def do_source(self, arg: str) -> bool | None: ... |
| 229 |
def do_undisplay(self, arg: str) -> bool | None: ... |
| 230 |
do_ll = do_longlist |
| 231 |
def _complete_location(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 232 |
def _complete_bpnumber(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 233 |
def _complete_expression(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 234 |
def complete_undisplay(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 235 |
def complete_unalias(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... |
| 236 |
complete_commands = _complete_bpnumber |
| 237 |
complete_break = _complete_location |
| 238 |
complete_b = _complete_location |
| 239 |
complete_tbreak = _complete_location |
| 240 |
complete_enable = _complete_bpnumber |
| 241 |
complete_disable = _complete_bpnumber |
| 242 |
complete_condition = _complete_bpnumber |
| 243 |
complete_ignore = _complete_bpnumber |
| 244 |
complete_clear = _complete_location |
| 245 |
complete_cl = _complete_location |
| 246 |
complete_debug = _complete_expression |
| 247 |
complete_print = _complete_expression |
| 248 |
complete_p = _complete_expression |
| 249 |
complete_pp = _complete_expression |
| 250 |
complete_source = _complete_expression |
| 251 |
complete_whatis = _complete_expression |
| 252 |
complete_display = _complete_expression |
| 253 |
|
| 254 |
if sys.version_info < (3, 11): |
| 255 |
def _runmodule(self, module_name: str) -> None: ... |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
def find_function(funcname: str, filename: str) -> tuple[str, str, int] | None: ... |
| 260 |
def main() -> None: ... |
| 261 |
def help() -> None: ... |
| 262 |
|
| 263 |
if sys.version_info < (3, 10): |
| 264 |
def getsourcelines(obj: _SourceObjectType) -> tuple[list[str], int]: ... |
| 265 |
|
| 266 |
def lasti2lineno(code: CodeType, lasti: int) -> int: ... |
| 267 |
|
| 268 |
class _rstr(str): |
| 269 |
def __repr__(self) -> Self: ... |