U
    `                     @   s@   d Z ddlZddlmZ dZdZdZdd	 Zd
d Zdd Z	dS )     N   )format_helpersZPENDINGZ	CANCELLEDZFINISHEDc                 C   s   t | jdo| jdk	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.8/asyncio/base_futures.pyisfuture   s    r
   c                 C   s   t | }|sd} dd }|dkr2|| d d } n`|dkr`d|| d d || d d } n2|dkrd|| d d |d || d	 d } d
|  dS )#helper function for Future.__repr__ c                 S   s   t | dS )Nr   )r   Z_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rP| jdk	r4|d| j nt| j}|d|  | jrf|t	| j | j
r| j
d }|d|d  d|d   |S )	r   Nz
exception=zresult=r   zcreated at r   :r   )Z_statelower	_FINISHEDZ
_exceptionappendreprlibreprZ_resultZ
_callbacksr   Z_source_traceback)Zfutureinforesultframer   r   r	   _future_repr_info,   s    


r    )
__all__r   r   r   Z_PENDINGZ
_CANCELLEDr   r
   r   r    r   r   r   r	   <module>   s   