Allow decorator frames to be marked as skippable....
Allow decorator frames to be marked as skippable.
When done so, by default pdb will step over those frames and directly
into the decorated functions.
>>> def helper_1():
... print("don't step in me")
...
...
... def helper_2():
... print("in me neither")
...
One can define a decorator that wrap a function between the two helpers:
>>> def pdb_skipped_decorator(function):
...
...
... def wrapped_fn(*args, **kwargs):
... __debuggerskip__ = True
... helper_1()
... __debuggerskip__ = False
... result = function(*args, **kwargs)
... __debuggerskip__ = True
... helper_2()
... return result
...
... return wrapped_fn
When decorating a function, ipdb will directly step into ``bar()`` by
default:
>>> @foo_decorator
... def bar(x, y):
... return x * y
You can toggle the behavior with
ipdb> skip_predicates debuggerskip False
or configure it in your ``.pdbrc``