Commit 99504dc0 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[rtags] Enhance repr of rtags

* we don't care of the class, the registry id is enough (never seen a case of
  sub-classing)

* add the module from which the rtag is coming as well as parent rtag if any.

--HG--
branch : 3.25
parent 1a5911825ef5
......@@ -88,7 +88,14 @@ class RelationTags(RegistrableRtags):
def __repr__(self):
# find a way to have more infos but keep it readable
# (in error messages in case of an ambiguity for instance)
return '%s (%s): %s' % (id(self), self.__regid__, self.__class__)
return '<%s %s>' % (self.__regid__, self._short_repr())
def _short_repr(self):
# find a way to have more infos but keep it readable
# (in error messages in case of an ambiguity for instance)
return '%s@0x%x%s' % (
self.__module__, id(self),
' derived from %s' % self._parent._short_repr() if self._parent else '')
# dict compat
def __getitem__(self, key):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment