zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
U
L±d«ã@sÆddlZddlZddlZddlZddlZddlZddlmZmZddl    m
Z
e  ¡dkZ ej dd…dkZej dd…dkZej dd…dkZd    d
„ZGd d „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úCd:\z\workplace\vscode\pyvenv\venv\Lib\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    Cs4zt |¡|_Wnttfk
r.d|_YnXdS©N)ÚinspectÚ    signaturerÚ
ValueErrorÚ    TypeError)ÚselfÚcallablerrrÚ__init__'sz_AnnotationExtractor.__init__cCs>|js
dSt|jj ¡ƒ}|r:|djtjjk    r:|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|jjtjjk    r|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
 rcstrdd„}|SzÒtjdkr&dd„}nŽdd„}|j}|jdksH|jdkrLt‚|jg}| |j    ¡| 
|j |j |j |j|j|j|j|j|j|j|j|j|jg ¡tj|މ‡fd    d„}d
d „}|ƒjd }||d ƒ|jd kràt‚Wntk
rútYSX|SdS)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/rrrr2Yscs|‰dS)NcsˆSrrr©ÚxrrÚforce_x_to_be_a_celleszQmake_set_closure_cell.<locals>.set_first_cellvar_to.<locals>.force_x_to_be_a_cellr)r1r7rr5rÚset_first_cellvar_to^sz3make_set_closure_cell.<locals>.set_first_cellvar_tor5rcs t ˆidd|f¡}||ƒdS)NÚsetterr)ÚtypesÚ FunctionType)r0r1r9©Zset_first_freevar_coderrr2†sÿcsd‰‡fdd„}|S)NcsˆSrrrr5rrÚfunc”sz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.funcr)r=rr5rÚmake_func_with_cell‘s z2make_set_closure_cell.<locals>.make_func_with_cellrédN)Ú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_cellGsL
 
  òÿ
 
 
 
rZcCs|jtkr|jSdS)zDIf this is a generic class (A[str]), return the generic base for it.N)Ú    __class__rÚ
__origin__)ZclrrrÚget_generic_baseµs
r])rÚplatformrAÚ    threadingr:r Úcollections.abcrrÚtypingrÚpython_implementationr@rBZ PY_3_9_PLUSZPY310Z PY_3_12_PLUSrrrZr2ÚlocalZ repr_contextr]rrrrÚ<module>s"  
(]