
    ")f	                        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d d
lmZ  G d d      Z ej*                         Zd Zy# e$ r eZY (w xY w)    N)MappingSequence)_GenericAliasPyPy   )      )r   	   )r   
   )r      )Protocolc                   (    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     I/var/www/html/flask-app/venv/lib/python3.12/site-packages/attr/_compat.py__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_type*   s^     xxdhh))0023fQi**'2C2C2I2II!9'''    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_type7   s<    
 HH**'2C2C2I2II88---r#   N)__name__
__module____qualname____doc__	__slots__r   r"   r'    r#   r   r   r      s    
 I
r#   r   c                 @    | j                   t        u r| j                  S y)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    	||}$}}r#   )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"f,r"f,!'#w. f.  % %h y {  s   B7 7C C