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