o
    …9j
  ã                   @   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 )zÓCheck 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    