o
    f
                     @   sR   d Z ddlZddlmZ ddlmZ dZdZdZd	d
 Z	dd Z
e Zdd ZdS )     N)	get_ident   )format_helpersPENDING	CANCELLEDFINISHEDc                 C   s   t | jdo
| jduS )zCheck for a Future.

    This returns True when obj is a Future instance or is advertising
    itself as duck-type compatible by setting _asyncio_future_blocking.
    See comment in Future for more details.
    _asyncio_future_blockingN)hasattr	__class__r	   )objr   r   +/usr/lib/python3.10/asyncio/base_futures.pyisfuture   s   r   c                 C   s   t | }|sd} dd }|dkr|| d d } n0|dkr0d|| d d || d d } n|dkrId|| d d |d || d	 d } d
|  dS )#helper function for Future.__repr__ c                 S   s   t | dS )Nr   )r   _format_callback_source)callbackr   r   r   	format_cb   s   z$_format_callbacks.<locals>.format_cbr   r      z{}, {}z{}, <{} more>, {}zcb=[])lenformat)cbsizer   r   r   r   _format_callbacks   s   &r   c              	   C   s   | j  g}| j tkrI| jdur|d| j n/t| t f}|tv r(d}nt| zt	
| j}W t| nt| w |d|  | jrT|t| j | jrk| jd }|d|d  d|d	   |S )
r   Nz
exception=z...zresult=r   zcreated at r   :r   )_statelower	_FINISHED
_exceptionappendidr   _repr_runningaddreprlibrepr_resultdiscard
_callbacksr   _source_traceback)futureinfokeyresultframer   r   r   _future_repr_info7   s$   



r0   )__all__r%   _threadr   r   r   _PENDING
_CANCELLEDr   r   r   setr#   r0   r   r   r   r   <module>   s    