From b83cefd918a933f5d211eb36c953e8c36e0c14a8 Mon Sep 17 00:00:00 2001 From: Rich Chiodo false Date: Wed, 1 May 2024 14:59:03 -0700 Subject: [PATCH] Feedback for step class rewrite --- src/debugpy/server/tracing/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/debugpy/server/tracing/__init__.py b/src/debugpy/server/tracing/__init__.py index 1c986c45..13004552 100644 --- a/src/debugpy/server/tracing/__init__.py +++ b/src/debugpy/server/tracing/__init__.py @@ -378,13 +378,13 @@ class StackFrame: class Step: + step: Literal["in", "out", "over"] + def __init__( self, - step: Literal["in", "out", "over", "goto"], origin: FrameType = None, origin_line: int = None, ): - self.step = step self.origin = origin self.origin_line = origin_line @@ -396,8 +396,7 @@ class Step: class StepIn(Step): - def __init__(self): - super().__init__("in") + step = "in" @override def is_complete(self, python_frame: FrameType) -> bool: @@ -407,9 +406,9 @@ class StepIn(Step): class StepOver(Step): - def __init__(self): - super().__init__("over") + step = "over" + @override def is_complete(self, python_frame: FrameType) -> bool: is_complete = True for python_frame, _ in traceback.walk_stack(python_frame): @@ -423,9 +422,9 @@ class StepOver(Step): class StepOut(Step): - def __init__(self): - super().__init__("out") + step = "out" + @override def is_complete(self, python_frame: FrameType) -> bool: is_complete = True for python_frame, _ in traceback.walk_stack(python_frame):