
    d                     H   d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl	m
Z
  ej                    dk    Zej        dd         dk    Zej        dd         dk    Zej        dd         dk    Zd	 Z G d
 d          Zd Z e            Z ej                    Zd ZdS )    N)MappingSequence)_GenericAliasPyPy   )   	   )r   
   )r      c                  >    t          j        dt          d           d S )NzRunning interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.r   )
stacklevel)warningswarnRuntimeWarning)argskws     P/home/feoh/.local/pipx/venvs/poetry/lib/python3.11/site-packages/attr/_compat.py	just_warnr      s2    M	8 	         c                   *    e Zd ZdZdgZd Zd Zd ZdS )_AnnotationExtractorz^
    Extract type annotations from a callable, returning None whenever there
    is none.
    sigc                 x    	 t          j        |          | _        d S # t          t          f$ r d | _        Y d S w xY wN)inspect	signaturer   
ValueError	TypeError)selfcallables     r   __init__z_AnnotationExtractor.__init__'   sJ    	(22DHHHI& 	 	 	DHHHH	s    99c                     | j         sdS t          | j         j                                                  }|r+|d         j        t
          j        j        ur|d         j        S dS )zU
        Return the type annotation of the first argument if it's not empty.
        Nr   )r   list
parametersvalues
annotationr   	Parameterempty)r   paramss     r   get_first_param_typez)_AnnotationExtractor.get_first_param_type-   sb     x 	4dh)002233 	(fQi*'2C2III!9''tr   c                 f    | j         r)| j         j        t          j        j        ur| j         j        S dS )z;
        Return the return type if it's not empty.
        N)r   return_annotationr   	Signaturer(   )r   s    r   get_return_typez$_AnnotationExtractor.get_return_type:   s4    
 H	.*'2C2III8--tr   N)__name__
__module____qualname____doc__	__slots__r!   r*   r.    r   r   r   r      sT         
 I    
 
 
 
 
r   r   c                  d   t           rd } | S 	 t          j        dk    rd } nd }|j        }|j        dk    s|j        dk    rt          |j        g}|                    |j	                   |
                    |j        |j        |j        |j        |j        |j        |j        |j        |j        |j        |j        |j        |j        g           t-          j        | fd} d } |            j        d	         } | |d
           |j        d
k    rt          	 | S # t4          $ r
 t6          cY S w xY w)z|Return a function of two arguments (cell, value) which sets
    the value stored in the closure cell `cell` to `value`.
    c                 2    |                      |f           d S r   )__setstate__cellvalues     r   set_closure_cellz/make_set_closure_cell.<locals>.set_closure_cellO   s    uh'''''r   )r      c                     || _         d S r   )cell_contentsr8   s     r   r;   z/make_set_closure_cell.<locals>.set_closure_cellY   s    %*"""r   c                     | d S r   r4   )r:   force_x_to_be_a_cellxs     @r   set_first_cellvar_toz3make_set_closure_cell.<locals>.set_first_cellvar_to^   s    r   rA   r4   c                 P    t          j        i dd| f          } ||           d S )Nsetterr4   )typesFunctionType)r9   r:   rE   set_first_freevar_codes      r   r;   z/make_set_closure_cell.<locals>.set_closure_cell   s7     +*B"tg  ur   c                      d fd} | S )Nc                       S r   r4   rC   s   r   funcz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.func   s    r   r4   )rK   rA   s    @r   make_func_with_cellz2make_set_closure_cell.<locals>.make_func_with_cell   s(    A     Kr   r   d   )PYPYsysversion_info__code__co_cellvarsco_freevarsAssertionErrorco_argcountappendco_kwonlyargcountextend
co_nlocalsco_stacksizeco_flagsco_code	co_constsco_namesco_varnamesco_filenameco_nameco_firstlineno	co_lnotabrF   CodeType__closure__r>   	Exceptionr   )r;   rB   cor   rL   r9   rH   s         @r   make_set_closure_cellrh   G   s      	( 	( 	(  K v%%+ + + +
   &.B~''2>R+?+?$$ N#DKK,---KKMOKJLKNNJ%LNN  $ &+^T%:"    	 	 	 #"$$03s###$$   %      s   D	D D/.D/c                 0    | j         t          u r| j        S dS )zDIf this is a generic class (A[str]), return the generic base for it.N)	__class__r   
__origin__)cls    r   get_generic_baserm      s    	|}$$}4r   )r   platformrO   	threadingrF   r   collections.abcr   r   typingr   python_implementationrN   rP   PY_3_9_PLUSPY310PY_3_12_PLUSr   r   rh   r;   localrepr_contextrm   r4   r   r   <module>rx      sI     



       - - - - - - - -             &x%''61rr"f,!'#w.  % % % % % % % %PZ  Z  Z z )(**  y      r   