Current File : //proc/self/root/usr/lib/python3/dist-packages/attr/__pycache__/_compat.cpython-312.pyc |
�
��e� � � � d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ ej � dk( Z
ej dd dk\ Zej dd dk\ Z
ej dd dk\ Zej dd d k\ Zej dk r d d
lmZ nd d
lmZ G d� d� Z ej* � Zd
� Zy# e$ r eZY �(w xY w)� N)�Mapping�Sequence)�
_GenericAlias�PyPy� )� � )r � )r �
)r � )�Protocolc �( � e Zd ZdZdgZd� Zd� Zd� Zy)�_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 xY w)N)�inspect� signaturer �
ValueError� TypeError)�self�callables �./usr/lib/python3/dist-packages/attr/_compat.py�__init__z_AnnotationExtractor.__init__$ s4 � � ��(�(��2�D�H���I�&� ��D�H� �s � �6�6c �� � | j syt | j j j � � }|r8|d j t
j j ur|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^ � � �x�x���d�h�h�)�)�0�0�2�3���f�Q�i�*�*�'�2C�2C�2I�2I�I��!�9�'�'�'�� c � � | j rF| j j t j j ur| 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<