{ } Raw JSON

bundles / IPython 9.17.0 / IPython / core / magic / MagicsManager / register_alias

function

IPython.core.magic:MagicsManager.register_alias

source: /dev/ipython/IPython/core/magic.py:704

Signature

def register_alias(self, alias_name: str, magic_name: str, magic_kind: _MagicKind = line, magic_params: str | None = None) → None

Summary

Register an alias to a magic function.

Extended Summary

The alias is an instance of MagicAlias, which holds the name and kind of the magic it should call. Binding is done at call time, so if the underlying magic function is changed the alias will call the new function.

Parameters

alias_name : str

The name of the magic to be registered.

magic_name : str

The name of an existing magic.

magic_kind : str

Kind of magic, one of 'line' or 'cell'

Aliases

  • IPython.core.magic.MagicsManager.register_alias