What cool hacks can be done using sys.settrace?

前端 未结 7 1652
無奈伤痛
無奈伤痛 2020-12-13 02:51

I love being able to modify the arguments the get sent to a function, using settrace, like :

import sys

def trace_func(frame,event,arg):
    va         


        
7条回答
  •  情歌与酒
    2020-12-13 03:34

    The python debugger Pdb uses sys.settrace to analyse lines to debug.

    Here's an c optimization/extension for pdb that also uses sys.settrace

    https://bitbucket.org/jagguli/cpdb

提交回复
热议问题