(future)
return info
helper function for Future.__repr__
helper function for Future.__repr__
helper function for Future . __repr__
def _future_repr_info(future):
    # (Future) -> str
    """helper function for Future.__repr__"""
    info = [future._state.lower()]
    if future._state == _FINISHED:
        if future._exception is not None:
            info.append(f'exception={future._exception!r}')
        else:
            key = id(future), get_ident()
            if key in _repr_running:
                result = '...'
            else:
                _repr_running.add(key)
                try:
                    # use reprlib to limit the length of the output, especially
                    # for very long strings
                    result = reprlib.repr(future._result)
                finally:
                    _repr_running.discard(key)
            info.append(f'result={result}')
    if future._callbacks:
        info.append(_format_callbacks(future._callbacks))
    if future._source_traceback:
        frame = future._source_traceback[-1]
        info.append(f'created at {frame[0]}:{frame[1]}')
    return info
def _future_repr_info ( future ) : # (Future) -> str info = [ future . _state . lower ( ) ] if future . _state == _FINISHED : if future . _exception is not None : info . append ( f'exception={future._exception!r}' ) else : key = id ( future ) , get_ident ( ) if key in _repr_running : result = '...' else : _repr_running . add ( key ) try : # use reprlib to limit the length of the output, especially # for very long strings result = reprlib . repr ( future . _result ) finally : _repr_running . discard ( key ) info . append ( f'result={result}' ) if future . _callbacks : info . append ( _format_callbacks ( future . _callbacks ) ) if future . _source_traceback : frame = future . _source_traceback [ - 1 ] info . append ( f'created at {frame[0]}:{frame[1]}' ) return info