##// END OF EJS Templates
Implement a better check for hidden values for %who etc.
Thomas Kluyver -
Show More
@@ -969,7 +969,7 b' class InteractiveShell(SingletonConfigurable):'
969 969
970 970 # A record of hidden variables we have added to the user namespace, so
971 971 # we can list later only variables defined in actual interactive use.
972 self.user_ns_hidden = set()
972 self.user_ns_hidden = {}
973 973
974 974 # Now that FakeModule produces a real module, we've run into a nasty
975 975 # problem: after script execution (via %run), the module where the user
@@ -1300,7 +1300,8 b' class InteractiveShell(SingletonConfigurable):'
1300 1300 # And configure interactive visibility
1301 1301 user_ns_hidden = self.user_ns_hidden
1302 1302 if interactive:
1303 user_ns_hidden.difference_update(vdict)
1303 for name in vdict:
1304 user_ns_hidden.pop(name, None)
1304 1305 else:
1305 1306 user_ns_hidden.update(vdict)
1306 1307
@@ -265,9 +265,10 b' class NamespaceMagics(Magics):'
265 265
266 266 user_ns = self.shell.user_ns
267 267 user_ns_hidden = self.shell.user_ns_hidden
268 nonmatching = object() # This can never be in user_ns
268 269 out = [ i for i in user_ns
269 270 if not i.startswith('_') \
270 and not i in user_ns_hidden ]
271 and (user_ns[i] is not user_ns_hidden.get(i, nonmatching)) ]
271 272
272 273 typelist = parameter_s.split()
273 274 if typelist:
General Comments 0
You need to be logged in to leave comments. Login now