From 641206824e24b42a83b1455988efcfe491fd9969 2011-11-10 01:36:59 From: Thomas Kluyver Date: 2011-11-10 01:36:59 Subject: [PATCH] Do not expose variables defined at startup to %who etc. Closes gh-697 --- diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index 6549c24..83eccbe 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -180,6 +180,9 @@ class InteractiveShellApp(Configurable): self._run_exec_lines() self._run_exec_files() self._run_cmd_line_code() + + # Hide variables defined here from %who etc. + self.shell.user_ns_hidden.update(self.shell.user_ns) def _run_exec_lines(self): """Run lines of code in IPythonApp.exec_lines in the user's namespace."""