##// END OF EJS Templates
MagicAlias: Make __doc__ an instance variable rather than a property....
Bradley M. Froehle -
Show More
@@ -647,7 +647,7 b' class Magics(object):'
647 self.options_table[fn] = optstr
647 self.options_table[fn] = optstr
648
648
649 class MagicAlias(object):
649 class MagicAlias(object):
650 """Store a magic alias.
650 """An alias to another magic function.
651
651
652 An alias is determined by its magic name and magic kind. Lookup
652 An alias is determined by its magic name and magic kind. Lookup
653 is done at call time, so if the underlying magic changes the alias
653 is done at call time, so if the underlying magic changes the alias
@@ -661,16 +661,10 b' class MagicAlias(object):'
661 self.magic_name = magic_name
661 self.magic_name = magic_name
662 self.magic_kind = magic_kind
662 self.magic_kind = magic_kind
663
663
664 self._in_call = False
664 self.pretty_target = '%s%s' % (magic_escapes[self.magic_kind], self.magic_name)
665
665 self.__doc__ = "Alias for `%s`." % self.pretty_target
666 @property
667 def pretty_target(self):
668 """A formatted version of the target of the alias."""
669 return '%s%s' % (magic_escapes[self.magic_kind], self.magic_name)
670
666
671 @property
667 self._in_call = False
672 def __doc__(self):
673 return "Alias for `%s`." % self.pretty_target
674
668
675 def __call__(self, *args, **kwargs):
669 def __call__(self, *args, **kwargs):
676 """Call the magic alias."""
670 """Call the magic alias."""
General Comments 0
You need to be logged in to leave comments. Login now