o
    Ñó·i  ã                   @   sâ   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 	¡ 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d… d
kZer\d dlZdd„ Zndd„ ZG dd„ dƒZe ¡ Zdd„ ZdS )é    N)ÚMappingÚSequence)Ú_GenericAliasÚPyPyé   )é   é
   )r   é   )r   é   )r   é   )r   é   c                 C   s   t j| t jjd�S )N)Úformat)ÚannotationlibÚget_annotationsZFormatZ
FORWARDREF©Úcls© r   úRC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\attr/_compat.pyÚ_get_annotations   s   ÿr   c                 C   s   | j  di ¡S )z,
        Get annotations for *cls*.
        Ú__annotations__N)Ú__dict__Úgetr   r   r   r   r   !   s   c                   @   s.   e Zd ZdZdgZdd„ Zdd„ Zdd„ Zd	S )
Ú_AnnotationExtractorz^
    Extract type annotations from a callable, returning None whenever there
    is none.
    Úsigc              	   C   s2   z	t  |¡| _W d S  ttfy   d | _Y d S w )N)ÚinspectÚ	signaturer   Ú
ValueErrorÚ	TypeError)ÚselfÚcallabler   r   r   Ú__init__0   s
   ÿz_AnnotationExtractor.__init__c                 C   s>   | 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   Úparamsr   r   r   Úget_first_param_type6   s   
z)_AnnotationExtractor.get_first_param_typec                 C   s"   | 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   r   r   r   Úget_return_typeC   s   ÿþz$_AnnotationExtractor.get_return_typeN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r    r(   r+   r   r   r   r   r   (   s    r   c                 C   s   | 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__)Zclr   r   r   Úget_generic_base_   s   
r3   )r   ÚplatformÚsysÚ	threadingÚcollections.abcr   r   Útypingr   Úpython_implementationZPYPYÚversion_infoZPY_3_10_PLUSZPY_3_11_PLUSZPY_3_12_PLUSZPY_3_13_PLUSZPY_3_14_PLUSr   r   r   ÚlocalZrepr_contextr3   r   r   r   r   Ú<module>   s&   
4