Start a new python3 session, add two command entries a=1 b=2 and evaluate the worksheet. The output for the second entry is the output of print(globals()) which is wrong.
Do you confirm this problem @Alex Semke? I can not confirm here. Are you using the master branch version?
Sorry, I can confirm the bug. The bug happen only if I press the "Evaluate worksheet" button. If I use the shortcut Shift+Enter to evaluate the worksheet, the bug doesn't happen.
"Shirt+Enter" evaluates the current command entry only. "Evaluate worksheet" evaluates all entries. The error/difference must be somewhere in CommandEntry::evaluate() being called with WorksheetEntry::EvaluateNext in Worksheet::evaluate().
*** Bug 363600 has been marked as a duplicate of this bug. ***
Looks like Minh Ngo fixed this bug with commit [1]. I am going to close it, if this bug is present yet please reopen it. [1] https://phabricator.kde.org/R55:1a55790f477f5f2ece5aa901b9a943f4f1d90d0a