调试和剖分析 ¶
这些库帮助您采用 Python 开发:调试器使您能够逐步遍历代码、分析堆栈帧和设置断点等,而剖分析器运行代码并给出执行时间的详细分解,使您能够识别程序中的瓶颈。审计事件提供运行时行为的可见性,否则要求侵入调试 (或打补丁)。
- 审计事件表
-
bdb— 调试器框架-
BdbQuit -
Breakpoint -
Bdb-
canonic() -
reset() -
trace_dispatch() -
dispatch_line() -
dispatch_call() -
dispatch_return() -
dispatch_exception() -
is_skipped_line() -
stop_here() -
break_here() -
break_anywhere() -
user_call() -
user_line() -
user_return() -
user_exception() -
do_clear() -
set_step() -
set_next() -
set_return() -
set_until() -
set_trace() -
set_continue() -
set_quit() -
set_break() -
clear_break() -
clear_bpbynumber() -
clear_all_file_breaks() -
clear_all_breaks() -
get_bpbynumber() -
get_break() -
get_breaks() -
get_file_breaks() -
get_all_breaks() -
get_stack() -
format_stack_entry() -
run() -
runeval() -
runctx() -
runcall()
-
-
checkfuncname() -
effective() -
set_trace()
-
-
faulthandler— 转储 Python 回溯 -
pdb— Python 调试器 - Python 剖分析器
-
timeit— 度量小代码片段的执行时间 -
trace— 跟踪或追踪 Python 语句的执行 -
tracemalloc— 跟踪内存分配