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

Method unalias

IPython/core/magics/osm.py:186–200  ·  view source on GitHub ↗

Remove an alias

(self, parameter_s='')

Source from the content-addressed store, hash-verified

184
185 @line_magic
186 def unalias(self, parameter_s=''):
187 """Remove an alias"""
188
189 aname = parameter_s.strip()
190 try:
191 self.shell.alias_manager.undefine_alias(aname)
192 except ValueError as e:
193 print(e)
194 return
195
196 stored = self.shell.db.get('stored_aliases', {} )
197 if aname in stored:
198 print("Removing %stored alias",aname)
199 del stored[aname]
200 self.shell.db['stored_aliases'] = stored
201
202 @line_magic
203 def rehashx(self, parameter_s=''):

Callers

nothing calls this directly

Calls 1

undefine_aliasMethod · 0.80

Tested by

no test coverage detected