Skip to content

Commit 5bb2842

Browse files
committed
Add comments for in_string
1 parent c86fa00 commit 5bb2842

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/pdb.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,11 @@ def input_auto_indent():
762762
# If the last line is empty, we don't need to indent
763763
return
764764

765+
# A stack to keep track of string delimiters (quotes). Push a
766+
# quote when entering a string, and pop it when the string
767+
# ends. When the stack is empty, we're not inside a string. If
768+
# encounter a '#' while not inside a string, it's a comment
769+
# start; otherwise, it's just a '#' character within a string.
765770
in_string: list[str] = []
766771
last_char = None
767772
last_line = last_line.rstrip('\r\n')

0 commit comments

Comments
 (0)