From 6c82a4572e14a7ce52f8bbd39f9b2beacc7e2ac5 2012-07-27 14:47:45 From: Bradley M. Froehle Date: 2012-07-27 14:47:45 Subject: [PATCH] Merge pull request #2200 from bfroehle/use_alias_magic documentation build broken in bb429da5b Sphinx breaks if a class's `__doc__` attribute is a property, so just set it as an instance variable in `MagicAlias.__init__` instead. --- diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 010f311..0b1dfe0 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -647,7 +647,7 @@ class Magics(object): self.options_table[fn] = optstr class MagicAlias(object): - """Store a magic alias. + """An alias to another magic function. An alias is determined by its magic name and magic kind. Lookup is done at call time, so if the underlying magic changes the alias @@ -661,16 +661,10 @@ class MagicAlias(object): self.magic_name = magic_name self.magic_kind = magic_kind - self._in_call = False - - @property - def pretty_target(self): - """A formatted version of the target of the alias.""" - return '%s%s' % (magic_escapes[self.magic_kind], self.magic_name) + self.pretty_target = '%s%s' % (magic_escapes[self.magic_kind], self.magic_name) + self.__doc__ = "Alias for `%s`." % self.pretty_target - @property - def __doc__(self): - return "Alias for `%s`." % self.pretty_target + self._in_call = False def __call__(self, *args, **kwargs): """Call the magic alias."""