Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I'm trying to subclass pdb to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behave...
#1: Initial revision
Is it possible to get the current function in a trace function?
I'm trying to subclass `pdb` to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behaved decorator using `@functools.wraps` sets `__wrapped__` attribute on the wrapper to point to the decorated function and `inspect.unwrap` can follow a chain of such decorators. So, I need access to the function object, but the trace function gives me the `frame` only and I don't know how to get the function object out of it.