##// END OF EJS Templates
Clean up output of %who
Fernando Perez -
Show More
@@ -970,7 +970,7 b' class InteractiveShell(Component, Magic):'
970 # user_ns, and we sync that contents into user_config_ns so that these
970 # user_ns, and we sync that contents into user_config_ns so that these
971 # initial variables aren't shown by %who. After the sync, we add the
971 # initial variables aren't shown by %who. After the sync, we add the
972 # rest of what we *do* want the user to see with %who even on a new
972 # rest of what we *do* want the user to see with %who even on a new
973 # session.
973 # session (probably nothing, so they really only see their own stuff)
974 ns = {}
974 ns = {}
975
975
976 # Put 'help' in the user namespace
976 # Put 'help' in the user namespace
@@ -987,20 +987,23 b' class InteractiveShell(Component, Magic):'
987
987
988 ns['_sh'] = shadowns
988 ns['_sh'] = shadowns
989
989
990 # Sync what we've added so far to user_config_ns so these aren't seen
990 # user aliases to input and output histories. These shouldn't show up
991 # by %who
991 # in %who, as they can have very large reprs.
992 self.user_config_ns.update(ns)
993
994 # Now, continue adding more contents
995
996 # user aliases to input and output histories
997 ns['In'] = self.input_hist
992 ns['In'] = self.input_hist
998 ns['Out'] = self.output_hist
993 ns['Out'] = self.output_hist
999
994
1000 # Store myself as the public api!!!
995 # Store myself as the public api!!!
1001 ns['get_ipython'] = self.get_ipython
996 ns['get_ipython'] = self.get_ipython
997
998 # Sync what we've added so far to user_config_ns so these aren't seen
999 # by %who
1000 self.user_config_ns.update(ns)
1001
1002 # Anything put into ns now would show up in %who. Think twice before
1003 # putting anything here, as we really want %who to show the user their
1004 # stuff, not our variables.
1002
1005
1003 # And update the real user's namespace
1006 # Finally, update the real user's namespace
1004 self.user_ns.update(ns)
1007 self.user_ns.update(ns)
1005
1008
1006
1009
General Comments 0
You need to be logged in to leave comments. Login now