Пример #1
0
 def __repr__(self):
     args = [repr(self.nodes[0]), repr(self.nodes[-1])]
     kwargs = OrderedDict()
     d = dict(self)
     for key in sorted(d):
         if CypherEncoder.is_safe_key(key):
             args.append("%s=%r" % (key, d[key]))
         else:
             kwargs[key] = d[key]
     if kwargs:
         args.append("**{%s}" % ", ".join("%r: %r" % (k, kwargs[k]) for k in kwargs))
     return "%s(%s)" % (self.__class__.__name__, ", ".join(args))
Пример #2
0
 def __repr__(self):
     args = list(map(repr, sorted(self.labels)))
     kwargs = OrderedDict()
     d = dict(self)
     for key in sorted(d):
         if CypherEncoder.is_safe_key(key):
             args.append("%s=%r" % (key, d[key]))
         else:
             kwargs[key] = d[key]
     if kwargs:
         args.append("**{%s}" % ", ".join("%r: %r" % (k, kwargs[k]) for k in kwargs))
     return "Node(%s)" % ", ".join(args)