Don't always place new variables before the modified ones

This commit is contained in:
Alexander Bersenev 2019-05-11 15:58:20 +05:00 committed by Ram Rachum
parent 49f7dd504b
commit cb280323e5
2 changed files with 2 additions and 4 deletions

View File

@ -296,9 +296,7 @@ class Tracer:
if name not in old_local_reprs:
self.write('{indent}{newish_string}{name} = {value_repr}'.format(
**locals()))
for name, value_repr in local_reprs.items():
if name in old_local_reprs and old_local_reprs[name] != value_repr:
elif old_local_reprs[name] != value_repr:
self.write('{indent}Modified var:.. {name} = {value_repr}'.format(
**locals()))

View File

@ -276,8 +276,8 @@ def test_watch_explode():
VariableEntry('(lst + [])[2]', '9'),
VariableEntry('lst + []'),
LineEntry(),
VariableEntry('(lst + [])[3]', '10'),
VariableEntry('lst'),
VariableEntry('(lst + [])[3]', '10'),
VariableEntry('lst + []'),
ReturnEntry(),
ReturnValueEntry('None')