c;ddlZddlZddlZddlZddlZddlZddlmZmZej dkZ ej dddkZ ej dddkZ dZGdd Zd ZeZejZdS) N)MappingSequencePyPy) )r c>tjdtddS)NzRunning interpreter doesn't sufficiently support code object introspection. Some features like bare super() or accessing __class__ will not work with slotted classes.r) stacklevel)warningswarnRuntimeWarning)argskws ./usr/lib/python3/dist-packages/attr/_compat.py just_warnrs2 M 8  c*eZdZdZdgZdZdZdZdS)_AnnotationExtractorz^ Extract type annotations from a callable, returning None whenever there is none. sigcx tj||_dS#ttf$r d|_YdSwxYwN)inspect signaturer ValueError TypeError)selfcallables r__init__z_AnnotationExtractor.__init__%sJ (22DHHHI&   DHHHH s 99c|jsdSt|jj}|r+|djt jjur |djSdS)zU Return the type annotation of the first argument if it's not empty. Nr)rlist parametersvalues annotationr Parameterempty)rparamss rget_first_param_typez)_AnnotationExtractor.get_first_param_type+sbx 4dh)002233  (fQi*'2C2III!9' 'trcf|jr)|jjtjjur |jjSdS)z; Return the return type if it's not empty. N)rreturn_annotationr Signaturer&)rs rget_return_typez$_AnnotationExtractor.get_return_type8s4 H .*'2C2III8- -trN)__name__ __module__ __qualname____doc__ __slots__rr(r,rrrrsT I        rrcdtrd}|Sd} |j}|jdks |jdkrtt jdkrd}n|jg}||j | |j |j |j |j|j|j|j|j|j|j|j|j|jg t-j|fd}d}|jd }||d |jd krt |S#t4$r t6cYSwxYw) z|Return a function of two arguments (cell, value) which sets the value stored in the closure cell `cell` to `value`. c2||fdSr) __setstate__cellvalues rset_closure_cellz/make_set_closure_cell..set_closure_cellMs   uh ' ' ' ' 'rc |dSrr2)r8force_x_to_be_a_cellxs @rset_first_cellvar_toz3make_set_closure_cell..set_first_cellvar_toUs rr<r2)rc||_dSr) cell_contentsr6s rr9z/make_set_closure_cell..set_closure_celljs%*"""rcPtjidd|f}||dS)Nsetterr2)types FunctionType)r7r8rCset_first_freevar_codes rr9z/make_set_closure_cell..set_closure_cells7+*B"tgu rcdfd}|S)NcSrr2r>srfuncz@make_set_closure_cell..make_func_with_cell..funcsrr2)rIr<s @rmake_func_with_cellz2make_set_closure_cell..make_func_with_cells(A     Krrd)PYPY__code__ co_cellvars co_freevarsAssertionErrorsys version_info co_argcountappendco_kwonlyargcountextend co_nlocals co_stacksizeco_flagsco_code co_constsco_names co_varnames co_filenameco_nameco_firstlineno co_lnotabrDCodeType __closure__rA Exceptionr)r9r=corrJr7rFs @rmake_set_closure_cellrfEs    ( ( (  @ " * >V # #r~';';   v % % + + + +N#D KK, - - - KKMOKJLKNNJ%LNN   $&+^T%: "        #"$$03s###   $ $  %   sDDD/.D/)rplatformrQ threadingrDr collections.abcrrpython_implementationrLrRPY310 PY_3_12_PLUSrrrfr9local repr_contextr2rrros   --------&x%''61 !'#w. %%%%%%%%PZ Z Z z)(**y  r