File: //opt/alt/python311/lib/python3.11/site-packages/attr/__pycache__/_compat.cpython-311.pyc
�
C�;f� � � � 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 n# e$ r eZY n
w xY wd d
lmZ G d� d� � Z ej � � Zd
� ZdS )� N)�Mapping�Sequence)�
_GenericAlias�PyPy� )� � )r � )r �
)r � )�Protocolc �* � e Zd ZdZdgZd� Zd� Zd� ZdS )�_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 xY w)N)�inspect� signaturer �
ValueError� TypeError)�self�callables �?/opt/alt/python311/lib/python3.11/site-packages/attr/_compat.py�__init__z_AnnotationExtractor.__init__$ sJ � � ��(��2�2�D�H�H�H���I�&� � � ��D�H�H�H�H� ���s � �9�9c �� � | j sdS t | j j � � � � � }|r+|d j t
j j ur
|d j S dS )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��d�h�)�0�0�2�2�3�3��� (�f�Q�i�*�'�2C�2I�I�I��!�9�'�'��t� c �f � | j r)| j j t j j ur| j j S dS )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� .���*�'�2C�2I�I�I��8�-�-��tr# N)�__name__�
__module__�__qualname__�__doc__� __slots__r r"