X Tutup
Skip to content

Commit 5abd6eb

Browse files
committed
Reset current function name after punctuations/operators. Fixes #127.
1 parent f73701a commit 5abd6eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bpython/repl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,17 @@ def get_args(self):
534534
stack[-1][1] += 1
535535
except TypeError:
536536
stack[-1][1] = ''
537+
stack[-1][0] = ''
537538
elif value == ':' and stack[-1][2] == 'lambda':
538539
stack.pop()
540+
else:
541+
stack[-1][0] = ''
539542
elif (token is Token.Name or token in Token.Name.subtypes or
540543
token is Token.Operator and value == '.'):
541544
stack[-1][0] += value
542545
elif token is Token.Operator and value == '=':
543546
stack[-1][1] = stack[-1][0]
547+
stack[-1][0] = ''
544548
elif token is Token.Keyword and value == 'lambda':
545549
stack.append(['', 0, value])
546550
else:

0 commit comments

Comments
 (0)
X Tutup