MCPcopy Index your code
hub / github.com/ipython/ipython / define_alias

Method define_alias

IPython/core/alias.py:233–241  ·  view source on GitHub ↗

Define a new alias after validating it. This will raise an :exc:`AliasError` if there are validation problems.

(self, name, cmd)

Source from the content-addressed store, hash-verified

231 error("Invalid alias: %s" % e)
232
233 def define_alias(self, name, cmd):
234 """Define a new alias after validating it.
235
236 This will raise an :exc:`AliasError` if there are validation
237 problems.
238 """
239 caller = Alias(shell=self.shell, name=name, cmd=cmd)
240 self.shell.magics_manager.register_function(caller, magic_kind='line',
241 magic_name=name)
242
243 def get_alias(self, name):
244 """Return an alias, or None if no alias by that name exists."""

Callers 7

soft_define_aliasMethod · 0.95
aliasMethod · 0.80
rehashxMethod · 0.80
restore_aliasesFunction · 0.80
test_alias_lifecycleFunction · 0.80
test_alias_args_errorFunction · 0.80

Calls 2

AliasClass · 0.85
register_functionMethod · 0.80

Tested by 3

test_alias_lifecycleFunction · 0.64
test_alias_args_errorFunction · 0.64