MCPcopy Create free account
hub / github.com/ipython/ipython / xdel

Method xdel

IPython/core/magics/namespace.py:693–708  ·  view source on GitHub ↗

Delete a variable, trying to clear it from anywhere that IPython's machinery has references to it. By default, this uses the identity of the named object in the user namespace to remove references held under other names. The object is also removed from the output hist

(self, parameter_s='')

Source from the content-addressed store, hash-verified

691
692 @line_magic
693 def xdel(self, parameter_s=''):
694 """Delete a variable, trying to clear it from anywhere that
695 IPython's machinery has references to it. By default, this uses
696 the identity of the named object in the user namespace to remove
697 references held under other names. The object is also removed
698 from the output history.
699
700 Options
701 -n : Delete the specified name from all namespaces, without
702 checking their identity.
703 """
704 opts, varname = self.parse_options(parameter_s,'n')
705 try:
706 self.shell.del_var(varname, ('n' in opts))
707 except (NameError, ValueError) as e:
708 print(type(e).__name__ +": "+ str(e))

Callers

nothing calls this directly

Calls 2

parse_optionsMethod · 0.80
del_varMethod · 0.80

Tested by

no test coverage detected