code: def recursive_repr(func):
      
      repr_running = set()
  
      @wraps(func)
      def wrapper(self):
          "Return ellipsis on recursive re-entry to function."
          key = id(self), get_ident()
  
          if key in repr_running:
              return '...'
  
          repr_running.add(key)
  
          try:
              return func(self)
          finally:
              repr_running.discard(key)
  
      return wrapper
docs: Decorator to prevent infinite repr recursion.