def __str__(self): if isinstance(self.val, BaseException): self.val = dict( symbol=self.lookup.get(type(self.val).__name__) or type(self.val).__name__, # :reply should only be used for error messages that can be # displayed to START users # use :message for Python exceptions kw={'message': str(self.val.message)} ) return output(u"(:error {symbol} {keys})".format( symbol=self.val['symbol'], keys=self._plist(sorted(self.val['kw'].items()))))
def __str__(self): return output(self.typed_value())
def __repr__(self): r = u"<%s object %s>" % (self.__class__.__name__, self.__str__()) return output(r)
def _kv_pair(self, k, v): if k is None: return output(u"%s" % v) if isinstance(k, basestring): return output(u":%s %s" % (k, v))
def __str__(self): pairs = sorted(self.val.items()) return output(u'(%s)' % self._plist(pairs))