
    Gd                    4   d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 d dlmZ ej        ej        eef         eef         Z G d d          Zde_         G d	 d          ZddZe
efZ G d de
          Z	 dddZddZ G d d          ZddZdS )    )annotationsN)partial)ref)BoundMethodWeakrefc                       e Zd Zd Zd Zd ZdS )_symbolc                "    |x| _         | _        dS )zConstruct a new named symbol.N)__name__name)selfr   s     N/var/www/html/t/fyr/venv311/lib/python3.11/site-packages/blinker/_utilities.py__init__z_symbol.__init__   s    $((			    c                     t           | j        ffS N)symbolr   r   s    r   
__reduce__z_symbol.__reduce__   s    	|##r   c                    | j         S r   )r   r   s    r   __repr__z_symbol.__repr__   s
    yr   N)r
   
__module____qualname__r   r   r    r   r   r   r      sA        ) ) )$ $ $    r   r   r   c                      e Zd ZdZi Zd ZdS )r   a?  A constant symbol.

    >>> symbol('foo') is symbol('foo')
    True
    >>> symbol('foo')
    foo

    A slight refinement of the MAGICCOOKIE=object() pattern.  The primary
    advantage of symbol() is its repr().  They are also singletons.

    Repeated calls of symbol('name') will all return the same instance.

    c                    	 | j         |         S # t          $ r+ | j                             |t          |                    cY S w xY wr   )symbolsKeyError
setdefaultr   )clsr   s     r   __new__zsymbol.__new__/   sS    	?;t$$ 	? 	? 	?;))$>>>>>	?s    2AAN)r
   r   r   __doc__r   r    r   r   r   r   r      s4          G? ? ? ? ?r   objobjectreturnIdentityTypec                <   t          | d          r(t          | j                  t          | j                  fS t          | d          r(t          | j                  t          | j                  fS t          | t          t          f          r| S t          |           S )N__func__im_func)	hasattridr'   __self__r(   im_self
isinstanceintstr)r"   s    r   hashable_identityr0   6   s    sJ 3<  "S\"2"233	i	 	  3;CK11	C#s	$	$ 
#wwr   c                  (    e Zd ZU dZded<   ded<   dS )annotatable_weakrefz7A weakref.ref that supports custom instance attributes.zt.Optional[IdentityType]receiver_id	sender_idN)r
   r   r   r!   __annotations__r   r   r   r2   r2   D   s0         AA))))''''''r   r2   c                    t          |           rt          | |          }nt          | |          } |j                    D ]\  }}t	          |||           |S )zReturn an annotated weak ref.)callablecallable_referencer2   itemssetattr)r#   callbackr   weakkeyvalues         r   	referencer?   K   sl      5!&(33"6844'k')) " "
Uc5!!!!Kr   c                    t          | d          r| j        t          | |          S t          | d          r| j        t          | |          S t	          | |          S )z@Return an annotated weak ref, supporting bound instance methods.r,   N)target	on_deleter+   )r)   r,   r   r+   r2   )r#   r;   s     r   r8   r8   X   sl    vy!! Efn&@!8DDDD		$	$ E)D!8DDDDvx000r   c                      e Zd ZdZd Zd ZdS )lazy_propertyz(A @property that is only evaluated once.c                ,    || _         |j        | _        d S r   )	_deferredr!   )r   deferreds     r   r   zlazy_property.__init__d   s    !'r   c                n    || S |                      |          }t          || j         j        |           |S r   )rF   r:   r
   )r   r"   r   r>   s       r   __get__zlazy_property.__get__h   s9    ;Ks##T^,e444r   N)r
   r   r   r!   r   rI   r   r   r   rD   rD   a   s8        22( ( (    r   rD   funct.Anyboolc                   t           j        dk    rt          j        |           S 	 ddlm} t          | |          rdS n# t          $ r Y nw xY wt          j	        |           r| j
        } t          j	        |           t          | t                    r| j        } t          | t                    t          j        |           sdS | j        j        t          j        z  rdS t          j        j        }t'          | dd           |u S )N)      r   )	AsyncMockTF_is_coroutine)sysversion_infoasyncioiscoroutinefunctionunittest.mockrP   r-   ImportErrorinspectismethodr'   r   rJ   
isfunction__code__co_flagsCO_COROUTINE
coroutinesrQ   getattr)rJ   rP   acics      r   is_coroutine_functionra   p   s(    6!!*4000
	//////$	** t 	 	 	D	 t$$ 	!=D t$$ 	!w'' 	9D w'' 	!$'' 	5=!G$88 	4!/t_d33t;;s   ? 
AA)r"   r#   r$   r%   r   )r$   r2   )rJ   rK   r$   rL   )
__future__r   rT   rX   rR   typingt	functoolsr   weakrefr   blinker._saferefr   UnionTupler.   r/   r%   r   r
   r   r0   	WeakTypesr2   r?   r8   rD   ra   r   r   r   <module>rk      s   " " " " " "   



                 / / / / / /wqwsCx(#s23	 	 	 	 	 	 	 	  ? ? ? ? ? ? ? ?0    $%	( ( ( ( (# ( ( ( 
 
 
 
 
1 1 1 1       < < < < < <r   