def __json__(self): result = collections.OrderedDict( __class__=self.__class__.__name__, ) result.update(self._pubdict()) return asjson(result)
def __json__(self): result = collections.OrderedDict(__class__=self.__class__.__name__, ) result.update(self._pubdict()) return asjson(result)
def asjson(self): return asjson(self)
def __json__(self): # preserve order return { asjson(k): asjson(v) for k, v in self.items() if not k.startswith('_') }