diff --git a/breakpoints.py b/breakpoints.py index 9d370c7..76f3a39 100644 --- a/breakpoints.py +++ b/breakpoints.py @@ -101,9 +101,11 @@ class NthBreakpoint: # FOR EXAMPLE: # class StepsPlusLookback(Lookback, StepsBreakpoint) # pass - - -class Lookback: +# +# ALTERNATIVELY, can be used entirely by itself, and will provide +# a lookback if the run() loop terminates for any reason (e.g., a HALT). +# +class Lookback(Breakpoint): def __init__(self, *args, lookbacks=100, **kwargs): self.__backstates = collections.deque([], lookbacks) @@ -118,6 +120,7 @@ class Lookback: return list(self.__backstates) + class MultiBreakpoint(Breakpoint): # a breakpoint that fires if any of the contained breakpoints fire