
    c;                        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  ej	                    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S )    N)MappingSequencePyPy   )   
   )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     ./usr/lib/python3/dist-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_type8   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 d }	 |j        }|j        dk    s|j        dk    rt          t
          j        dk    rd } n|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_cellM   s    uh'''''r   c                     | d S r   r2   )r8   force_x_to_be_a_cellxs     @r   set_first_cellvar_toz3make_set_closure_cell.<locals>.set_first_cellvar_toU   s    r   r<   r2   )r      c                     || _         d S r   )cell_contentsr6   s     r   r9   z/make_set_closure_cell.<locals>.set_closure_cellj   s    %*"""r   c                 P    t          j        i dd| f          } ||           d S )Nsetterr2   )typesFunctionType)r7   r8   rC   set_first_freevar_codes      r   r9   z/make_set_closure_cell.<locals>.set_closure_cell   s7     +*B"tg  ur   c                      d fd} | S )Nc                       S r   r2   r>   s   r   funcz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.func   s    r   r2   )rI   r<   s    @r   make_func_with_cellz2make_set_closure_cell.<locals>.make_func_with_cell   s(    A     Kr   r   d   )PYPY__code__co_cellvarsco_freevarsAssertionErrorsysversion_info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_lnotabrD   CodeType__closure__rA   	Exceptionr   )r9   r=   cor   rJ   r7   rF   s         @r   make_set_closure_cellrf   E   s      	( 	( 	(  
  @  "*>V##r~';';   v%%+ + + + 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/)r   platformrQ   	threadingrD   r   collections.abcr   r   python_implementationrL   rR   PY310PY_3_12_PLUSr   r   rf   r9   localrepr_contextr2   r   r   <module>ro      s     



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