##// END OF EJS Templates
Shell's reset method clears namespace from last %run command.
Thomas Kluyver -
Show More
@@ -1038,10 +1038,8 b' class InteractiveShell(Configurable, Magic):'
1038 1038 self.user_ns.update(ns)
1039 1039
1040 1040 def reset(self, new_session=True):
1041 """Clear all internal namespaces.
1042
1043 Note that this is much more aggressive than %reset, since it clears
1044 fully all namespaces, as well as all input/output lists.
1041 """Clear all internal namespaces, and attempt to release references to
1042 user objects.
1045 1043
1046 1044 If new_session is True, a new history session will be opened.
1047 1045 """
@@ -1078,6 +1076,9 b' class InteractiveShell(Configurable, Magic):'
1078 1076 # Flush the private list of module references kept for script
1079 1077 # execution protection
1080 1078 self.clear_main_mod_cache()
1079
1080 # Clear out the namespace from the last %run
1081 self.new_main_mod()
1081 1082
1082 1083 def reset_selective(self, regex=None):
1083 1084 """Clear selective variables from internal namespaces based on a
@@ -10,10 +10,11 b' import sys'
10 10 class C(object):
11 11 def __init__(self,name):
12 12 self.name = name
13 self.flush_stdout = sys.stdout.flush
13 14
14 15 def __del__(self):
15 16 print 'tclass.py: deleting object:',self.name
16 sys.stdout.flush()
17 self.flush_stdout()
17 18
18 19 try:
19 20 name = sys.argv[1]
@@ -202,5 +202,6 b' class TestMagicRunSimple(tt.TempFileMixin):'
202 202 ARGV 1-: [u'C-first']
203 203 ARGV 1-: [u'C-second']
204 204 tclass.py: deleting object: C-first
205 tclass.py: deleting object: C-second
205 206 """
206 207 tt.ipexec_validate(self.fname, out)
General Comments 0
You need to be logged in to leave comments. Login now