HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/attr/__pycache__/_compat.cpython-310.pyc
o

"we��@s�ddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
e��dkZej
dd�dkZej
dd�dkZej
dd�dkZd	d
�ZGdd�d�Zd
d�Ze�Ze��Zdd�ZdS)�N)�Mapping�Sequence)�
_GenericAlias�PyPy�)��	)r�
)r�cOstjdtdd�dS)Nz�Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.r)�
stacklevel)�warnings�warn�RuntimeWarning)�args�kw�r�E/home/arjun/projects/env/lib/python3.10/site-packages/attr/_compat.py�	just_warns

�rc@s.eZdZdZdgZdd�Zdd�Zdd�Zd	S)
�_AnnotationExtractorz^
    Extract type annotations from a callable, returning None whenever there
    is none.
    �sigc	Cs2z	t�|�|_WdSttfyd|_YdSw�N)�inspect�	signaturer�
ValueError�	TypeError)�self�callablerrr�__init__'s
�z_AnnotationExtractor.__init__cCs>|jsdSt|jj���}|r|djtjjur|djSdS)zU
        Return the type annotation of the first argument if it's not empty.
        Nr)r�list�
parameters�values�
annotationr�	Parameter�empty)r�paramsrrr�get_first_param_type-s
z)_AnnotationExtractor.get_first_param_typecCs"|jr|jjtjjur|jjSdS)z;
        Return the return type if it's not empty.
        N)r�return_annotationr�	Signaturer#)rrrr�get_return_type:s
�z$_AnnotationExtractor.get_return_typeN)�__name__�
__module__�__qualname__�__doc__�	__slots__rr%r(rrrrrs
rcs�trdd�}|Szjtjdkrdd�}nGdd�}|j}|jdks$|jdkr&t�|jg}|�|j	�|�
|j|j|j
|j|j|j|j|j|j|j|j|j|jg
�tj|���fd	d�}d
d�}|�jd}||d
�|jd
krpt�W|Sty}tYSw)z|Return a function of two arguments (cell, value) which sets
    the value stored in the closure cell `cell` to `value`.
    cSs|�|f�dSr)�__setstate__��cell�valuerrr�set_closure_cellOsz/make_set_closure_cell.<locals>.set_closure_cell)r�cSs
||_dSr)�
cell_contentsr/rrrr2Ys
cs|�dSrr)r1�force_x_to_be_a_cellr��xr�set_first_cellvar_to^sz3make_set_closure_cell.<locals>.set_first_cellvar_tor6rcs t��idd|f�}||�dS)N�setterr)�types�FunctionType)r0r1r9��set_first_freevar_coderrr2�s�csd��fdd�}|S)Ncs�Srrrr6rr�func�sz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.funcr)r>rr6r�make_func_with_cell�sz2make_set_closure_cell.<locals>.make_func_with_cellr�d)�PYPY�sys�version_info�__code__�co_cellvars�co_freevars�AssertionError�co_argcount�append�co_kwonlyargcount�extend�
co_nlocals�co_stacksize�co_flags�co_code�	co_consts�co_names�co_varnames�co_filename�co_name�co_firstlineno�	co_lnotabr:�CodeType�__closure__r4�	Exceptionr)r2r8�corr?r0rr<r�make_set_closure_cellGsP

��


���r[cCs|jtur|jSdS)zDIf this is a generic class (A[str]), return the generic base for it.N)�	__class__r�
__origin__)�clrrr�get_generic_base�s
r_)r�platformrB�	threadingr:r�collections.abcrr�typingr�python_implementationrArC�PY_3_9_PLUS�PY310�PY_3_12_PLUSrrr[r2�local�repr_contextr_rrrr�<module>s$
(]