
    /Jf	                        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ej        dd         d	k    Zej        dk     r	 d d
lmZ n# e$ r eZY n
w xY wd d
lmZ  G d d          Z ej                    Zd ZdS )    N)MappingSequence)_GenericAliasPyPy   )      )r   	   )r   
   )r      )Protocolc                   *    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     O/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/attr/_compat.py__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''t    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_type7   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                 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_baser2   S   s    	|}$$}4r#   )r   platformsys	threadingcollections.abcr   r   typingr   python_implementationPYPYversion_infoPY_3_8_PLUSPY_3_9_PLUSPY310PY_3_12_PLUStyping_extensionsr   ImportErrorobjectr   localrepr_contextr2   r-   r#   r   <module>rD      s|     



     - - - - - - - -             &x%''61rr"f,rr"f,!'#w. f.......     % % % % % % % %h y      s   
B BB