def __repr__(self, _repr_running={}): # pylint: disable=W0102 'od.__repr__() <==> repr(od)' call_key = id(self), _get_ident() if call_key in _repr_running: return '...' _repr_running[call_key] = 1 try: if not self: return '{0}()'.format(self.__class__.__name__) return '{0}(\'{1}\')'.format(self.__class__.__name__, list(self.items())) finally: del _repr_running[call_key]
def __repr__(self, _repr_running={}): # pylint: disable=W0102 "od.__repr__() <==> repr(od)" call_key = id(self), _get_ident() if call_key in _repr_running: return "..." _repr_running[call_key] = 1 try: if not self: return "{0}()".format(self.__class__.__name__) return "{0}('{1}')".format(self.__class__.__name__, list(self.items())) finally: del _repr_running[call_key]