
    q&f                     &   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Zej                  dd dk\  Ze
sereZnd dlmZ eZd Z G d	 d
      Zd Z e       Z ej.                         Zy)    N)MappingSequencePyPy   )      )r   
   )OrderedDictc                  <    t        j                  dt        d       y )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     C/usr/lib/python3/dist-packages/mercurial/thirdparty/attr/_compat.py	just_warnr      s    MM	8 	    c                   (    e Zd ZdZdgZd Zd Zd Zy)_AnnotationExtractorz^
    Extract type annotations from a callable, returning None whenever there
    is none.
    sigc                 r    	 t        j                  |      | _        y # t        t        f$ r
 d | _        Y y w xY wN)inspect	signaturer   
ValueError	TypeError)selfcallables     r   __init__z_AnnotationExtractor.__init__.   s4    	((2DHI& 	DH	s    66c                     | j                   syt        | j                   j                  j                               }|r8|d   j                  t
        j                  j                  ur|d   j                  S y)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_type4   s^     xxdhh))0023fQi**'2C2C2I2II!9'''r   c                     | j                   rF| j                   j                  t        j                  j                  ur| j                   j                  S y)z;
        Return the return type if it's not empty.
        N)r   return_annotationr   	Signaturer'   )r   s    r   get_return_typez$_AnnotationExtractor.get_return_typeA   s<    
 HH**'2C2C2I2II88---r   N)__name__
__module____qualname____doc__	__slots__r    r)   r-    r   r   r   r   &   s    
 I
r   r   c                     t         rd } | S d }	 |j                  }|j                  dk7  s|j                  dk7  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*                  |j                  |j                  g       t-        j.                  | fd} d } |       j0                  d	   } | |d
       |j2                  d
k7  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                 (    | j                  |f       y r   )__setstate__cellvalues     r   set_closure_cellz/make_set_closure_cell.<locals>.set_closure_cellV   s    uh'r   c                 
    | y r   r3   )r9   force_x_to_be_a_cellxs     @r   set_first_cellvar_toz3make_set_closure_cell.<locals>.set_first_cellvar_to^   s    r   r=   r3   )r      c                     || _         y r   )cell_contentsr7   s     r   r:   z/make_set_closure_cell.<locals>.set_closure_cells   s
    %*"r   c                 J    t        j                  i dd| f      } ||       y )Nsetterr3   )typesFunctionType)r8   r9   rD   set_first_freevar_codes      r   r:   z/make_set_closure_cell.<locals>.set_closure_cell   s+     ++*B"tg ur   c                      d fd} | S )Nc                       S r   r3   r?   s   r   funcz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.func   s    r   r3   )rJ   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_lnotabrE   CodeType__closure__rB   	Exceptionr   )r:   r>   cor   rK   r8   rG   s         @r   make_set_closure_cellrg   N   s_    	(  
@  "**>>V#r~~';   v%+ NN#DKK,,-KKMMOOKKJJLLKKNNNNJJ%%LLNNNN$ &+^^T%:"	 #$003s#$   %    s   EE/ /F F)r   platformrR   	threadingrE   r   collections.abcr   r   python_implementationrM   rS   PY36HAS_F_STRINGSPY310dictordered_dictcollectionsr
   r   r   rg   r:   localrepr_contextr3   r   r   <module>rt      s      
    - &x%%'61
v%!' 4L'L% %PZ z )*  y r   