Skip to content

Commit a063e25

Browse files
committed
simplified code
1 parent e4d9f4f commit a063e25

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

larray_editor/editor.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,10 @@ def _display_in_grid(self, k, v):
574574

575575
def ipython_cell_executed(self):
576576
user_ns = self.kernel.shell.user_ns
577-
ip_keys = set(['In', 'Out', '_', '__', '___',
578-
'__builtin__',
579-
'_dh', '_ih', '_oh', '_sh', '_i', '_ii', '_iii',
580-
'exit', 'get_ipython', 'quit'])
577+
ip_keys = {'In', 'Out', '_', '__', '___', '__builtin__', '_dh', '_ih', '_oh', '_sh', '_i', '_ii', '_iii',
578+
'exit', 'get_ipython', 'quit'}
581579
# '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__',
582-
clean_ns_keys = set([k for k, v in user_ns.items() if not history_vars_pattern.match(k)]) - ip_keys
583-
clean_ns = {k: v for k, v in user_ns.items() if k in clean_ns_keys}
580+
clean_ns = {k: v for k, v in user_ns.items() if k not in ip_keys and not history_vars_pattern.match(k)}
584581

585582
# user_ns['_i'] is not updated yet (refers to the -2 item)
586583
# 'In' and '_ih' point to the same object (but '_ih' is supposed to be the non-overridden one)

0 commit comments

Comments
 (0)