parameters: (obj, maxLen=200, strFactor=10, _visitedIds=None)
docstring: caps the length of iterable types, so very large objects will print faster.
      also prevents infinite recursion
docstring_summary: caps the length of iterable types, so very large objects will print faster.
      also prevents infinite recursion
docstring_tokens: caps the length of iterable types so very large objects will print faster . also prevents infinite recursion
function: def fastRepr(obj, maxLen=200, strFactor=10, _visitedIds=None):
      """ caps the length of iterable types, so very large objects will print faster.
      also prevents infinite recursion """
      try:
          if _visitedIds is None:
              _visitedIds = set()
          if id(obj) in _visitedIds:
              return '<ALREADY-VISITED %s>' % itype(obj)
          if type(obj) in (tuple, list):
              s = ''
              s += {tuple: '(',
                    list:  '[',}[type(obj)]
              if maxLen is not None and len(obj) > maxLen:
                  o = obj[:maxLen]
                  ellips = '...'
              else:
                  o = obj
                  ellips = ''
              _visitedIds.add(id(obj))
              for item in o:
                  s += fastRepr(item, maxLen, _visitedIds=_visitedIds)
                  s += ', '
              _visitedIds.remove(id(obj))
              s += ellips
              s += {tuple: ')',
                    list:  ']',}[type(obj)]
              return s
          elif type(obj) is dict:
              s = '{'
              if maxLen is not None and len(obj) > maxLen:
                  o = list(obj.keys())[:maxLen]
                  ellips = '...'
              else:
                  o = list(obj.keys())
                  ellips = ''
              _visitedIds.add(id(obj))
              for key in o:
                  value = obj[key]
                  s += '%s: %s, ' % (fastRepr(key, maxLen, _visitedIds=_visitedIds),
                                     fastRepr(value, maxLen, _visitedIds=_visitedIds))
              _visitedIds.remove(id(obj))
              s += ellips
              s += '}'
              return s
          elif type(obj) is str:
              if maxLen is not None:
                  maxLen *= strFactor
              if maxLen is not None and len(obj) > maxLen:
                  return safeRepr(obj[:maxLen])
              else:
                  return safeRepr(obj)
          else:
              r = safeRepr(obj)
              maxLen *= strFactor
              if len(r) > maxLen:
                  r = r[:maxLen]
              return r
      except:
          return '<** FAILED REPR OF %s **>' % obj.__class__.__name__
function_tokens: def fastRepr ( obj , maxLen = 200 , strFactor = 10 , _visitedIds = None ) : try : if _visitedIds is None : _visitedIds = set ( ) if id ( obj ) in _visitedIds : return '<ALREADY-VISITED %s>' % itype ( obj ) if type ( obj ) in ( tuple , list ) : s = '' s += { tuple : '(' , list : '[' , } [ type ( obj ) ] if maxLen is not None and len ( obj ) > maxLen : o = obj [ : maxLen ] ellips = '...' else : o = obj ellips = '' _visitedIds . add ( id ( obj ) ) for item in o : s += fastRepr ( item , maxLen , _visitedIds = _visitedIds ) s += ', ' _visitedIds . remove ( id ( obj ) ) s += ellips s += { tuple : ')' , list : ']' , } [ type ( obj ) ] return s elif type ( obj ) is dict : s = '{' if maxLen is not None and len ( obj ) > maxLen : o = list ( obj . keys ( ) ) [ : maxLen ] ellips = '...' else : o = list ( obj . keys ( ) ) ellips = '' _visitedIds . add ( id ( obj ) ) for key in o : value = obj [ key ] s += '%s: %s, ' % ( fastRepr ( key , maxLen , _visitedIds = _visitedIds ) , fastRepr ( value , maxLen , _visitedIds = _visitedIds ) ) _visitedIds . remove ( id ( obj ) ) s += ellips s += '}' return s elif type ( obj ) is str : if maxLen is not None : maxLen *= strFactor if maxLen is not None and len ( obj ) > maxLen : return safeRepr ( obj [ : maxLen ] ) else : return safeRepr ( obj ) else : r = safeRepr ( obj ) maxLen *= strFactor if len ( r ) > maxLen : r = r [ : maxLen ] return r except : return '<** FAILED REPR OF %s **>' % obj . __class__ . __name__