ML i UdZddlmZddlZddlZddlmZddlmZddl m Z m Z ddl m Z mZddlmZmZmZmZmZmZmZmZdd lmZmZdd lmZddlZdd l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9dd l:m;Z;dd lZ>m?Z?ddl@mAZAmBZBmCZCerddlDmEZEGddZFerddlGZedZHeIeJefZKdeLd<dZMdeLd<dZNdeLd<dZOdeLd<dZPdeLd<dZQdeLd<dZRdeLd<dZSdeLd<dZTdeLd <dZUdeLd!<eMd"eNd#eOd$ePd%iZVdeLd&<eVjDcic]\}}|| c}}ZXdeLd'<d(ddd(d(ddd)ZYdeLd*<d+d,d-d.d/d0d1d2d3d4d5 ZZdeLd6<d7d8iZ[deLd9<d3d4d:Z\deLd;<dd?d@Z]deLdA<dBZ^deLdC<dDZ_deLdE<GdFdGeFZ`eGdHdIe`ZaeGdJdKe`ZbGdLdMebZcebZddeLdN<eGdOdPe`ZeefeJdQedRfZgdeLdS<GdTdUeeZhGdVdWeaZiGdXdYeiZjGdZd[eiZkGd\d]eiZlgd^ZmdeLd_<Gd`dae`ZnedbZodeLdc<GdddeeneeeaZpGdfdge`ZqdZrdeLdh<dZsdeLdi<dZtdeLdj<GdkdlZuemgdmzZvdeLdn<GdodpenZwevgdqzZxdeLdr<dZydeLds<dZzdeLdt<dZ{deLdu<GdvdweweeeaZ|epe|fZ}deLdx<GdydzeeeaZ~gd{ZdeLd|<Gd}d~eeZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddeaZGddebZGddebZdNdZGddebZGddebZGddebZGddebZGddebZGddebZGddeZGddeZeGdde ZejDZdeLd<ejFZdeLd<ejHZdeLd<ejJZdeLd<ejLZdeLd<ejNZdeLd<eeeeeefZdeLd<GdDŽdebZGdɄdebZGd˄debZGd̈́debZGdτdebZGdфdebZGdӄdebZGdՄdebZGdׄdebZGdلdebZGdۄdebZGd݄debZGd߄debZGddewebZGddebZGddebZGddebZGddebZGddebZGddebZGddebZGddebZGddebZGddebZdZdeLd<dZdeLd<dZdeLd<dZdeLd<GddeeebZefZdeLd<GddeūZGddeūZGddeūZGddebZGddebZGdd ebZGd d ebZGd d ebZGddebZGddebZGddebZehdZdeLd<ehdZdeLd<GddReeZGddeիZe֐dZאdeLd<e֐dZؐdeLd<e֐d ZِdeLd!<e֐d"ZdeLd#<Gd$d%eeZGd&d'eeZGd(dQZGd)d*eIeJefZGd+d,ZސdOd-ZߐdPd.ZdQd/ZdQd0ZdRd1ZejDcic]3\}}e|eur$e|ere|eer|eeur||j5c}}ZdeLd2< dSd3Z dT dUd4ZdVd5ZdWd6ZdXd7Z dY dZd8ZdZd9eLd:<dZd9eLd;<dZd9eLd<<dZd9eLd=<d>Zd9eLd?<d@Zd9eLdA<dBZd9eLdC<dDZd9eLdE<dFZd9eLdG<dHZd9eLdI<dJZd9eLdK<d[dLZd\dMZycc}}wcc}}w(]z4Abstract syntax tree node classes (i.e. parse tree).) annotationsN)abstractmethod) defaultdict)IteratorSequence)Enumunique) TYPE_CHECKINGAnyCallableFinalOptionalTypeVarUnioncast) TypeAlias TypeGuard)trait)LITERAL_COMPLEX LITERAL_NONEBufferTag read_bool read_floatread_int read_int_list read_int_opt read_literalread_str read_str_list read_str_optread_str_opt_listread_tag write_bool write_intwrite_int_list write_int_opt write_literal write_strwrite_str_list write_str_optwrite_str_opt_list write_tag)Options) is_sunderis_typeshed_file short_type)ExpressionVisitor NodeVisitorStatementVisitor)Patternc@eZdZdZdZdddZ d d dZy) Contextz@Base type for objects that are valid as error message locations.linecolumnend_line end_columnc<||_||_d|_d|_yNr8)selfr9r:s P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/nodes.py__init__zContext.__init__9s  $( &*Nct|tr||_nD|j|_|j|_|j|_|j |_|||_|||_|||_yy)zIf target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node. N) isinstanceintr9r:r;r<)r?targetr:r;r<s r@set_linezContext.set_line?so fc "DI DI --DK"OODM$//DO   DK  $DM  !(DO "rB)rH)r9rEr:rEreturnNoneNNN rFz Context | intr: int | Noner;rMr<rMrIrJ)__name__ __module__ __qualname____doc__ __slots__rArGrBr@r7r74sOJ LAMBDA_NAMEc,eZdZdZdZddZddZd dZy) Nodez4Common base class for all non-type parse tree nodes.rScp|jtjjt SNoptions)acceptmypystrconvStrConvr.r?s r@__str__z Node.__str__s%{{4<<// /BCCrBcl|jtjj|}|sJ|Sr)rrrr)r?ras r@str_with_optionszNode.str_with_optionss. KK ,,W,= >qrBc,tdt|NzNot implemented RuntimeErrortyper?visitors r@rz Node.accept,d4j99rBNrIstr)rr.rIrrzNodeVisitor[T]rIrT)rNrOrPrQrRrrrrSrBr@rrs>ID :rBrceZdZdZdZddZy) StatementzA statement node.rSc,tdt|rrrs r@rzStatement.acceptrrBNrzStatementVisitor[T]rIrTrNrOrPrQrRrrSrBr@rrsI:rBrceZdZdZdZddZy) ExpressionzAn expression node.rSc,tdt|rrrs r@rzExpression.acceptrrBNrzExpressionVisitor[T]rIrTrrSrBr@rrsI:rBrceZdZdZdZy)FakeExpressionzA dummy expression. We need a dummy expression in one place, and can't instantiate Expression because it is a trait and mypyc barfs. rSN)rNrOrPrQrRrSrBr@rrs IrBrLvalueceZdZdZdZeed dZeed dZed dZ e d dZ d dZ e ddZ y ) SymbolNodez+Nodes that can be stored in a symbol table.rScyr>rSrs r@namezSymbolNode.name rBcyr>rSrs r@fullnamezSymbolNode.fullnamerrBcyr>rSrs r@ serializezSymbolNode.serializes rBcf|d}tj|}|||Std|)N.classzunexpected .class )deserialize_mapgetNotImplementedError)clsdata classnamemethods r@ deserializezSymbolNode.deserializes>N  $$Y/  $< !$6yk"BCCrBcHtd|jjd)NzCannot serialize instance)r __class__rNr?rs r@writezSymbolNode.writes"!$5dnn6M6M5Ni"XYYrBc4td|jd)NzCannot deserialize r)rrNrrs r@readzSymbolNode.reads!$7 ~Y"OPPrBNrrIrV)rrVrIrrrrIrJ)rrrIr)rNrOrPrQrRpropertyrrrr classmethodrrrrSrBr@rrs5I       DDZQQrBrSymbolTableNodeTypeInfo Definitionc\eZdZUdZdZdZded<ded<ded<d ed <d ed <d ed<ded<ded<ded<d ed<d ed<d ed<ded<ded<ded< d* d+fd Zd,dZe d-d Z e d-d!Z d.d"Z d/d#Z d0d$Zd1d%Zd2d&Zed3d'Zd4d(Zed5d)ZxZS)6MypyFilez1The abstract syntax tree of a single source file.) _fullnamepathdefs alias_depsis_bomnamesimports ignored_lines skipped_linesis_stubis_cache_skeletonis_partial_stub_package plugin_depsfuture_import_flags_is_typeshed_file)rrrrrrlist[Statement]rzdefaultdict[str, set[str]]rboolr SymbolTablerlist[ImportBase]rzdict[int, list[str]]rzset[int]rrrrzdict[str, set[str]]rzset[str]r bool | NonercBt|||_d|_d|_||_||_tt|_ i|_ |r||_ ni|_ t|_ d|_ d|_d|_d|_t|_d|_y)NrXrF)superrArr9r:rrrsetrrrrrrrrrr)r?rrrrrs r@rAzMypyFile.__init__Ts      %c* !.D !#D  U  !&',$#&5 !%rBcBt|j|jS)zyReturn all definitions within the module (including nested). This doesn't include imported definitions. )local_definitionsrrrs r@rzMypyFile.local_definitionsps !T]];;rBcZ|jsdS|jjddS)Nr.rHrsplitrs r@rz MypyFile.namews'rJT^^-A-A#-Fr-JJrBc|jSr>rrs r@rzMypyFile.fullname{ ~~rBc$|j|Sr>)visit_mypy_filers r@rzMypyFile.accept&&t,,rBct|jdk7xr8tjj|jj dS)Nrz __init__.)lenrosbasename startswithrs r@is_package_init_filezMypyFile.is_package_init_files8499~"Zrww'7'7 'B'M'Mk'ZZrBc||jvSr>)r)r?flags r@is_future_flag_setzMypyFile.is_future_flag_setst////rBc||j%t|j|j|_|jSr>)rr0abs_custom_typeshed_dirrr?rs r@r0zMypyFile.is_typeshed_files6  ! ! )%5g6U6UW[W`W`%aD "%%%rBc d|j|jj|j|j|j|j t |jdS)Nr)rrrrrrr)rrrrrrsortedrrs r@rzMypyFile.serializesQ ZZ))$..9||II'+'C'C#)$*B*B#C  rBc|ddk(sJ|tgg}|d|_tj|d|_|d|_|d|_|d|_d|_t|d |_ |S) NrrrrrrrTr) rrrrrrrrrrrrrtrees r@rzMypyFile.deserializesH~+1T1+Bk* ,,T']; I L '+,E'F$!%#&t,A'B#C  rBc^t|tt||j|jj ||jt ||jt||jt ||jt|t|jyr>) r- MYPY_FILEr)rrrr$rrrr*rrrs r@rzMypyFile.writess$ "$' t~~.4&$ "4556tVD$<$<=>rBc:t|tk(sJtgg}t||_t j ||_t||_ t||_ t||_ tt||_d|_|SNT)r#rrrrrrrrrrrrr rrrs r@rz MypyFile.reads~~***B!$ %%d+   TN '0$#&}T':#; !% rB)FN) rrrrrrrzdict[int, list[str]] | NonerIrJ)rIIterator[Definition]rrrIr)rrrIr)rr.rIrr)rrVrIrr)rrrIr)rNrOrPrQrR__match_args__rlrArrrrrrrr0rrrrr __classcell__rs@r@rrs%;I$.NN I ** L  (' M"!$$!!"" 59 &&"& & 3 &  &8<KK-[0&    ?  rBrcReZdZUdZdZded<ded<ded<ded<d fd ZxZS) ImportBasez%Base class for all import statements.)is_unreachable is_top_level is_mypy_only assignmentsrr r r zlist[AssignmentStmt]r cZt|g|_d|_d|_d|_yNF)rrAr r r r r?rs r@rAzImportBase.__init__s. #!!rBrIrJ)rNrOrPrQrRrlrArrs@r@rrs//QI&%""rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) Importzimport m [as n])idslist[tuple[str, str | None]]rc0t|||_yr>)rrAr)r?rrs r@rAzImport.__init__s rBc$|j|Sr>) visit_importrs r@rz Import.accepts##D))rB)rrrIrJr rNrOrPrQrRrrlrArrrs@r@rrs IN %%*rBrcTeZdZUdZdZdZded<ded<ded<d fd Zd d ZxZ S) ImportFromzfrom m import x [as y], ...)idrrelativerrrErrrcLt|||_||_||_yr>)rrArrr)r?rrrrs r@rAzImportFrom.__init__s#    rBc$|j|Sr>)visit_import_fromrs r@rzImportFrom.accept((..rB)rrrrErrrIrJrrrs@r@rrs*%+I0N GM ''! /rBrcJeZdZUdZdZdZded<ded<d fd Zd dZxZ S) ImportAllzfrom m import *)rrrrrErc>t|||_||_yr>)rrArr)r?rrrs r@rAzImportAll.__init__s   rBc$|j|Sr>)visit_import_allrs r@rzImportAll.accept ''--rB)rrrrErIrJrrrs@r@r"r"s$"I'N GM! .rBr") is_propertyis_class is_staticis_finalFUNCBASE_FLAGScheZdZdZdZdfd ZeeddZeddZ ed dZ xZ S) FuncBaseaAbstract base class for function-like nodes. N.B: Although this has SymbolNode subclasses (FuncDef, OverloadedFuncDef), avoid calling isinstance(..., FuncBase) on something that is typed as SymbolNode. This is to work around mypy bug #3603, in which mypy doesn't understand multiple inheritance very well, and will assume that a SymbolNode cannot be a FuncBase. Instead, test against SYMBOL_FUNCBASE_TYPES, which enumerates SymbolNode subclasses that are also FuncBase subclasses. ) runanalyzed_typeinfor'r(r)r*is_explicit_overrideis_type_check_onlyrct|d|_d|_t|_d|_d|_d|_d|_ d|_ d|_ d|_ y)NFr) rrArr. FUNC_NO_INFOr/r'r(r)r*r0r1rrs r@rAzFuncBase.__init__-s\ 37 =A     $)!"'rBcyr>rSrs r@rz FuncBase.nameArrBc|jSr>rrs r@rzFuncBase.fullnameFrrBc>|j xs|jdk(S)a If used as a method, does it have an argument for method binding (`self`, `cls`)? This is true for `__new__` even though `__new__` does not undergo method binding, because we still usually assume that `cls` corresponds to the enclosing class. __new__)r)rrs r@has_self_or_cls_argumentz!FuncBase.has_self_or_cls_argumentJs>>!;TYY)%;;rBrrr) rNrOrPrQrRrArrrrr8rrs@r@r-r-sX  I(  <r?zOverloadPart | Noner@ str | NonerArMrBct|||_|j|_d|_d|_d|_d|_|r-|j|dj|djyyNr) rrAr>copyr?r@rArBrCrGr9r:r?r>rs r@rAzOverloadedFuncDef.__init__psg  %   -1  MM%(--q 9 rBc|jr|jdjS|jJ|jjSrG)r>rr@rs r@rzOverloadedFuncDef.name|s= ::::a=%% %99( ((99>> !rBc`|j |jSt|jD]w\}}|dkDs |jsdnd}t |t r|j r8d|_yt|j|kDs|jj rpd|_yd|_y)zCheck we can use bind_self() fast path for this overload. This will return False if at least one overload: * Has an explicit self annotation, or Self in signature. * Has a non-trivial decorator. rrXFT) rC enumerater>r'rDr9is_trivial_selfr decoratorsfunc)r?iitemtrivials r@rMz!OverloadedFuncDef.is_trivial_selfs  ,(( ( , GAtq5(8(8aaG$(++,1D) T__%/tyy7P7P(-% !%rBc|jd}t|tsJ|jjsJ|j J|j|j }t|tsJ|SrG)r>rDr:varis_settable_propertyrB)r? first_itemrQs r@setterzOverloadedFuncDef.settersoZZ] *i000~~2222  ,,,zz$++,$ *** rBc$|j|Sr>)visit_overloaded_func_defrs r@rzOverloadedFuncDef.accept0066rBc ^d|jDcgc]}|jc}|jdn|jj|j|jdn|jjt |t |j|jdScc}w)Nr=)rr>rrr@flagsrArB) r>rrrr@ get_flagsr+rArB)r?rPs r@rzOverloadedFuncDef.serializes)-1ZZ8akkm8 II-D4993F3F3H II-D4993F3F3Ht^4// --  8sB*c |ddk(sJt|dDcgc]%}tttj |'c}}|j dhtttj |d|_t|jdkDr%|j|j j|j dOtjj|d}t|tjjsJ||_|d|_t%||d|d |_|d |_|Scc}w) Nrr=r>r@rrrr\rArB)r=rr;rrrr@rr>rGr9rtypesdeserialize_typerD ProperTyperr set_flagsrArB)rrdrestyps r@rzOverloadedFuncDef.deserializesH~!4444DHM RqT, 6 6q 9 : R  88F  'L**@*@f*NOCH399~! SXX]]+ 88F  '**--d6l;Cc4::#8#89 99CHZ( #tG}%l+/ ! Ss*Ec t|tt|t|j|jD]}|j |t jj||jt||j|j t|dn't|d|jj |t||tt!||j"t%||j&yNFT)r-OVERLOADED_FUNC_DEFr%rr>rrr_write_type_optrr)rr@r$ write_flagsr+r+rAr'rB)r?rrQs r@rzOverloadedFuncDef.writes$+,$DJJ(JJ D JJt   !!$ 2$' 99  tU # tT " IIOOD !D$/dDOO,dD--.rBcFttt|Dcgc] }t|c}}tj j |}|-t|tj jsJ||_ t||_ t|rMt||_ t|jdkDr%|j!|jj"t%||t&t)||_t-||_|Scc}wrG)r=rangerread_overload_partrr_ read_type_optrDrarrrrr@rr>rGr9 read_flagsr+r!rArrB)rr_rdres r@rzOverloadedFuncDef.reads5RVCX Ya!3D!9 YZjj&&t, ?c4::#8#89 99CH  T?)$/CH399~! SXX]]+4n-%d+'- !ZsDc:td|jDS)Nc3<K|]}|jywr>) is_dynamic.0rQs r@ z/OverloadedFuncDef.is_dynamic..s<4??$<)allr>rs r@rszOverloadedFuncDef.is_dynamics<<<rDrIrJrr)rIr:rr)rrVrIr=r)rrrIr=)rNrOrPrQrRrlrArrrMrWrrrrrrrsrrs@r@r=r=WsI ((  :"",7  */ $=rBr=cleZdZdZdZdZ d dfd Z d dfd ZxZS) Argumentz A single argument in a FuncItem.)variabletype_annotation initializerkindpos_onlycht|||_||_||_||_||_yr>)rrAr{r|r}r~r)r?r{r|r}r~rrs r@rAzArgument.__init__s5   .&   rBct||||||jr_|jjdkrF|jj|j|j|j |j |jj|j|j|j |j yrG)rrGr}r9r:r;r<r{)r?rFr:r;r<rs r@rGzArgument.set_line s :>    0 0 5 5 9    % %diidmmT__ ] tyy$++t}}dooVrBF) r{Varr|mypy.types.Type | Noner}Expression | Noner~ArgKindrrrIrJrKrL) rNrOrPrQrRrrArGrrs@r@rzrzs*RIWN ! !0 !' !  !  !  !$"#!% W W W W  W  W WrBrz TYPE_VAR_KINDPARAM_SPEC_KINDTYPE_VAR_TUPLE_KINDc0eZdZdZ ddZy) TypeParamrr~ upper_boundvaluesdefaultcJ||_||_||_||_||_yr>r)r?rr~rrrs r@rAzTypeParam.__init__!s(  &  rBN) rrr~rErrrlist[mypy.types.Type]rrrIrJ)rNrOrPrRrArSrBr@rrsFDI   ,  &  (   rBr) is_overload is_generator is_coroutineis_async_generatoris_awaitable_coroutineFUNCITEM_FLAGScXeZdZdZdZdZ d dfd Zd dZd dZxZ S) FuncItemz9Base class for nodes usable as overloaded function items.) arguments arg_names arg_kindsmin_argsmax_pos type_argsbodyrrrrrexpanded)rrrct||xsg|_|jDcgc]&}|jrdn|jj (c}|_|jDcgc]}|jc}|_|jjt|jjtz|_ ||_ |xs tg|_||_||_d|_d|_d|_d|_d|_g|_d|_t3t5|jD]0}|j|||j7ks'|dz|_2ycc}wcc}w)NFrrX)rrArrr{rrr~rcountARG_POSARG_OPTrrBlockrrr.rrrrrrrrlrmax_fixed_argc)r?rrrerargrPrs r@rAzFuncItem.__init__Ps9 "bQUQ_Q_`##,,$CLL4E4EE`=A^^(Lc(L NN009DNN>*+ &A~~a (Q1D1D1F-F !A  &a(Ls +E5*E:c|jSr>)rrs r@rzFuncItem.max_fixed_argcls ||rBc|jduSr>rrs r@rszFuncItem.is_dynamicosyyD  rB)NNNN) rlist[Argument] | Noner Block | Noneremypy.types.FunctionLike | Nonerlist[TypeParam] | NonerIrJ)rIrEr) rNrOrPrQrR __deletable__rArrsrrs@r@rr9saCI$9M,0!.2,0 &(&&, & * &  &8!rBr) is_decoratedis_conditionalis_trivial_bodyrMr  FUNCDEF_FLAGS NOT_ABSTRACT IS_ABSTRACTIMPLICITLY_ABSTRACTceZdZdZdZdZ d d fd Zed dZddZ ddZ e ddZ dd Z e dd ZxZS)r9zQFunction definition. This is a non-lambda function defined using 'def'. ) _namerrabstract_status original_defrrMhas_self_attr_defr dataclass_transform_spec docstringrAoriginal_first_arg)rrrrc*t|||||||_d|_d|_t |_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_|r|djj |_yd|_y)NFr)rrArrrrrrrr rrrArMrr{rr)r?rrrrerrs r@rAzFuncDef.__init__s D#y9 !#+ %>B!GK%%)&* %!& 2;A,2G2G2L2LD #&*D #rBc|jSr>rrs r@rz FuncDef.name zzrBc$|j|Sr>)visit_func_defrs r@rzFuncDef.accept%%d++rBc d|j|j|j|jDcgc]}t |j c}|j dn|j jt|t|j|jdn|jj|j|jd Scc}w)Nr9) rrrrrrr\rrrAr)rrrrrEvaluerrr]rrrrAr)r?xs r@rzFuncDef.serializes JJ04?1#agg,? II-D4993F3F3Ht]3#3300822<<>//"&"9"9!  @sC c |ddk(sJtg}t|dg||ddnCttjj tjj |d}|d|_t||d|d|_ |jd|_ |d Dcgc] }t| c}|_ |d |_|d tj!|d nd|_|d |_|`|`|`|Scc}w) Nrr9rrrr\rrrrrrA)rr9rrr_ FunctionLiker`rrbrrr ARG_KINDSrrDataclassTransformSpecrrrArrr)rrrretrs r@rzFuncDef.deserializes'H~***Ry L  <'$**114::3N3NtTZ|3\]  Z( #tG}%[) !%*>!?/3K/@A!1A "#45./; # . .t4N/O P $ l+ M K L Bs0Dc t|tt||jtj j ||jt||jt||tt||jt||jDcgc]}t|j c}t#||j$|j& t)|dn't)|d|j&j+|t-||j.t-||j0ycc}wrg)r-FUNC_DEFr)rrr_rirrrjrr,rr&rrErr%rrr$rr+rAr)r?raks r@rz FuncDef.writes$!$ # !!$ 2$'D$ .40tdnnEc"((mEF$,,-  ( ( 0 tU # tT "  ) ) / / 5dDOO,dD334Fs"E ct|}d}t|rtjj |}t |gt g|}t||_t||tt||_ t|Dcgc] }t| c}|_t||_t|rt"j%||_t)||_t)||_|`|`|`|Scc}wr>)rrrr_read_function_liker9rrrorr"rrrrrrrrrr!rArrrr)rrrrerrs r@rz FuncDef.reads~.2 T?**//5CdBb 3/  4m,)$/ 1>t1DE22E &tn T?+A+F+Ft+LC (%d+!-d!3 M K L Fs D)rNNNN) rrrrrrrerrrrIrJrrr)rrVrIr9r)rrrIr9)rNrOrPrQrRrrArrrrrrrrrrs@r@r9r9s I";N +/!.2,0 "+"+)"+ "+ , "+ * "+ "+H, 4@5"rBr9SYMBOL_FUNCBASE_TYPESceZdZUdZdZdZded<ded<ded<d ed <d ed <dfd ZeddZ eddZ eddZ eddZ eddZ ddZddZed dZd!dZed"dZddZxZS)#r:zhA decorated function. A single Decorator object can include any number of function decorators. )rOrNoriginal_decoratorsrTr)rNrTrOr9rOlist[Expression]rNrrrTrrct|||_||_|j |_||_d|_yr)rrArOrNrHrrTr)r?rOrNrTrs r@rAzDecorator.__init__Es:  $#-??#4  rBc.|jjSr>)rOrrs r@rzDecorator.nameMyy~~rBc.|jjSr>)rOrrs r@rzDecorator.fullnameQyy!!!rBc.|jjSr>)rOr*rs r@r*zDecorator.is_finalUrrBc.|jjSr>)rOr/rs r@r/zDecorator.infoYrrBc.|jjSr>)rTrrs r@rzDecorator.type]sxx}}rBc$|j|Sr>)visit_decoratorrs r@rzDecorator.acceptarrBcd|jj|jj|jdS)Nr:)rrOrTr)rOrrTrrs r@rzDecorator.serializeds8!II'')88%%'++   rBc|ddk(sJttj|dgtj|d}|d|_|S)Nrr:rOrTr)r:r9rrr)rrdecs r@rzDecorator.deserializelsPH~,,,++DL92stTY{?[\}- rBct|t|jj||jj|t ||j yr>)r- DECORATORrOrrTr$rrs r@rzDecorator.writess<$ "  t4))*rBct|tk(sJtj|}t|tk(sJt j|}t |g|}t||_|Sr>) r#rr9rVARrr:rr)rrrOrTrs r@rzDecorator.readys_~)))||D!~$$$hhtnb#&#D/ rBc6|jjSr>)rOrsrs r@rszDecorator.is_dynamicyy##%%rB)rOr9rNrrTrrIrJrr)rIrrIrrr)rrVrIr:r)rrrIr:)rNrOrPrQrRrrlrArrrr*r/rrrrrrrrsrrs@r@r:r:3s TI2N M  )) H!""""-  + &rBr:)is_selfis_clsis_initialized_in_classis_staticmethodis_classmethodr'rUis_suppressed_import is_classvaris_abstract_varr* is_index_varfinal_unset_in_classfinal_set_in_initexplicit_self_typeis_ready is_inferredinvalid_partial_typefrom_module_getattrhas_explicit_valueallow_incompatible_override VAR_FLAGSceZdZdZdZdZd dfd ZeddZeddZ ddZ ddZ dd Z e dd Zdd Ze dd ZxZS)rzPA variable. It can refer to global/local variable or a data attribute. )rrr/r setter_type final_valuerrrrrrrr'rUrrr*rrrrrrrrr)rrrct|||_d|_t|_||_d|_d|_d|_ d|_ |j du|_ d|_ d|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_y)NrFT)rrArr VAR_NO_INFOr/rrrrrrrrrr'rUrrrrr*rrrrrrrr)r?rrrs r@rAz Var.__init__s   ,0 ;?   99,',$$# $)! $!%*! GK$)!!&#(#( #(+0(%*!rBc|jSr>rrs r@rzVar.namerrBc|jSr>rrs r@rz Var.fullnamerrBcl|jxs |j}d|dtt|dS)Nz)rrhexrr?rs r@__repr__z Var.__repr__s1}}) thd3r$x=/33rBc$|j|Sr>) visit_varrs r@rz Var.accept s  &&rBc *d|j|j|jdn|jj|jdn|jjt |t d}|j|j|d<|S)Nr)rrrrrr\r)rrrrrr]rrrs r@rz Var.serialize sJJ II-D4993F3F3H#'#3#3#;4AQAQA[A[A]tY/      '"&"2"2D  rBc|ddk(sJ|d}|ddn!tjj|d}|ddn!tjj|d}t||}|Jt |tjj r$t |tjj sJ||_d|_|d|_ t||d|jd |_ |S) NrrrrrFrr\r) rr_r`rrDra CallableTyperrrrbrr)rrrrrvs r@rzVar.deserializesH~&&&F|F|+t1L1LTRX\1ZM"* ,,T--@A  dO  +tzz'<'<=; (?(?@  A$  :& !T']#/ rBcrt|tt||jtj j ||jtj j ||jt||jt||tt||jyr>)r-rr)rrr_rirrrrjrr(rrs r@rz Var.write3sv$$ # !!$ 2 !!$(8(89$'D$ *dD,,-rBc2t|}tjj|}t ||}d}t |rQt |tjjk(sJtjjj|}||_ d|_ t||_ t||tt |}|tk(r%t!t#|t#||_|S|t&k7rt)|||_|Sr)rrr_rnrrr# CALLABLE_TYPErrrrrrorrcomplexrrrr)rrrrerrmarkers r@rzVar.read<s~jj&&t, cN6: T?D>TZZ%=%== ==**1166t)rrrrrIrJrrr)rrVrIrr)rrrIr)rNrOrPrQrRrrArrrr rrrrrrrrs@r@rrs I<5N6*p4' ,.rBrc`eZdZUdZdZdZded<ded<ded<d ed <d ed <d ed<d ed<ded<ded<d ed<ded<ded<ded<ded< d% d&fd Zed'dZ e jd(dZ d)dZ d*d Z d+d!Z ed,d"Zd-d#Zed.d$ZxZS)/ClassDefzClass definition)rrrr type_varsbase_type_exprsremoved_base_type_exprsr/ metaclassrNkeywordsanalyzedhas_incompatible_baseclassrremoved_statements)rrrrrrrrrz list[mypy.types.TypeVarLikeType]rrrrrr/rrrNzdict[str, Expression]rrrrrrc&t|||_d|_||_|xsg|_||_|xsg|_g|_t|_ ||_ g|_ |r t|ni|_d|_d|_d|_g|_yNrF)rrArrrrrrrCLASSDEF_NO_INFOr/rrNdictrrrrr) r?rrrrrrrrs r@rAzClassDef.__init__|s   "b".4"')$$ "*2X  */'%)"$rBc|jSr>rrs r@rzClassDef.fullnamerrBc||_yr>rr?rs r@rzClassDef.fullname rBc$|j|Sr>)visit_class_defrs r@rzClassDef.acceptrrBc6|jjSr>)r/ is_genericrs r@r+zClassDef.is_genericrrBcd|j|j|jDcgc]}|jc}dScc}w)Nr)rrrr)rrrrr&s r@rzClassDef.serializes=!II 15@A!++-@   AsA c  |ddk(sJt|dtg|dDcgc]C}ttjj tjj |Ec}}|d|_|Scc}w)Nrrrrr)rrrrr_TypeVarLikeTyper`r)rrrrds r@rzClassDef.deserializesH~+++ L "Ik* TZZ//1L1LQ1OP   J'   sAB ct|tt||jtj j ||jt||jyr>) r- CLASS_DEFr)rrr_write_type_listrrrs r@rzClassDef.writes@$ "$ " ""48$ &rBc tt|tgtt |Dcgc]!}t j j|#c}}t||_|Scc}wr>) rrrrlrrr_read_type_var_liker)rrrprds r@rz ClassDef.readsX TN "I:?:O PQTZZ * *4 0 P   ~   Qs&A/ )NNNNN)rrrrr'list[mypy.types.TypeVarLikeType] | Nonerzlist[Expression] | Nonerrrz#list[tuple[str, Expression]] | NonerrrIrJrrrrIrJrrr)rrVrIrr)rrrIr)rNrOrPrQrRrrlrArrrWrr+rrrrrrrs@r@rrQs1I$&N IN K%%//%%-- N    ## $$'' >B37'+8<,0%%%; % 1 % % %6%*% %6__-&   ' rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) GlobalDeclzDeclaration global x, y, ...r list[str]rc0t|||_yr>rrArr?rrs r@rAzGlobalDecl.__init__  rBc$|j|Sr>)visit_global_declrs r@rzGlobalDecl.acceptr rBrr9rIrJrrrs@r@r7r7s &IN /rBr7c@eZdZUdZdZdZded<dfd ZddZxZ S) NonlocalDeclzDeclaration nonlocal x, y, ...r8r9rc0t|||_yr>r;r<s r@rAzNonlocalDecl.__init__r=rBc$|j|Sr>)visit_nonlocal_declrs r@rzNonlocalDecl.accept**400rBr@rrrs@r@rBrBs (IN 1rBrBc6eZdZdZdZdddfdZddZxZS)r)rr F)r c>t|||_||_yr>)rrArr )r?rr rs r@rAzBlock.__init__s  -rBc$|j|Sr>) visit_blockrs r@rz Block.accepts""4((rB)rrr rrIrJr)rNrOrPrRrrArrrs@r@rrs*I/NHM-)rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) ExpressionStmtz/An expression as a statement, such as print(s).exprrrNc0t|||_yr>rrArNr?rNrs r@rAzExpressionStmt.__init__  rBc$|j|Sr>)visit_expression_stmtrs r@rzExpressionStmt.accept,,T22rBrNrrIrJrrrs@r@rLrLs 9IN 3rBrLceZdZUdZdZdZded<ded<ded <ded <d ed <d ed <d ed<d ed< d dfd ZddZxZ S)AssignmentStmtabAssignment statement. The same node class is used for single assignment, multiple assignment (e.g. x, y = z) and chained assignment (e.g. x = y = z), assignments that define new names, and assignments with explicit types ("# type: t" or "x: t [= ...]"). An lvalue can be NameExpr, TupleExpr, ListExpr, MemberExpr, or IndexExpr. )lvaluesrvaluerr. new_syntax is_alias_def is_final_definvalid_recursive_alias)rYrvaluesr list[Lvalue]rYrrZrrr.rr[r\r]r^ct|||_||_||_||_||_d|_d|_d|_ yr) rrArYrZrr.r[r\r]r^)r?rYrZrr[rs r@rAzAssignmentStmt.__init__FsL    #$!!',$rBc$|j|Sr>)visit_assignment_stmtrs r@rzAssignmentStmt.acceptWrUrBr) rYr`rZrrrr[rrIrJrrrs@r@rXrXs I4N    ++"! (, ---% -  -  -"3rBrXcTeZdZUdZdZdZded<ded<ded <d fd Zd d ZxZ S)OperatorAssignmentStmtz,Operator assignment statement such as x += 1)oplvaluerZ)rgrfrZrrfrrgrrZcLt|||_||_||_yr>)rrArfrgrZ)r?rfrgrZrs r@rAzOperatorAssignmentStmt.__init__fs#   rBc$|j|Sr>)visit_operator_assignment_stmtrs r@rzOperatorAssignmentStmt.acceptl55d;;rB)rfrrgrrZrrIrJrrrs@r@rere[s*6*I/N G N  rrArNrror?rNrrors r@rAzWhileStmt.__init__y#   "rBc$|j|Sr>)visit_while_stmtrs r@rzWhileStmt.acceptr&rB)rNrrrrorrIrJr rNrOrPrRrrlrArrrs@r@rmrmps(-I2N  K# .rBrmceZdZUdZdZded<ded<ded<ded<ded <d ed <d ed <ded<ded< d dfd ZddZxZS)ForStmt) index index_typeunanalyzed_index_typeinferred_item_typeinferred_iterator_typerNrrois_async)ryrzrNrrorryrrzr{r|r}rrNrrrrorr~ct|||_||_||_d|_d|_||_||_||_ d|_ yr) rrAryrzr{r|r}rNrror~)r?ryrNrrorzrs r@rAzForStmt.__init__sR  $%/""&&*#  " rBc$|j|Sr>)visit_for_stmtrs r@rzForStmt.acceptrrBr>) ryrrNrrrrorrzrrIrJrrvrs@r@rxrxs IJN M&&11..22  KN.2     +  &,rBrxc<eZdZUdZdZded<dfd ZddZxZS) ReturnStmtrMrrNc0t|||_yr>rPrQs r@rAzReturnStmt.__init__rRrBc$|j|Sr>)visit_return_stmtrs r@rzReturnStmt.acceptr rBrNrrIrJrrvrs@r@rrsIN /rBrcHeZdZUdZdZded<ded<dd fd Zd dZxZS) AssertStmt)rNmsgrrNrrc>t|||_||_yr>)rrArNr)r?rNrrs r@rAzAssertStmt.__init__s  rBc$|j|Sr>)visit_assert_stmtrs r@rzAssertStmt.acceptr rBr>)rNrrrrIrJrrvrs@r@rrs#I$N   /rBrc<eZdZUdZdZded<dfd ZddZxZS)DelStmtrMrrNc0t|||_yr>rPrQs r@rAzDelStmt.__init__rRrBc$|j|Sr>)visit_del_stmtrs r@rzDelStmt.acceptrrB)rNrrIrJrrvrs@r@rrsIN L,rBrceZdZdZddZy) BreakStmtrSc$|j|Sr>)visit_break_stmtrs r@rzBreakStmt.acceptr&rBNrrNrOrPrRrrSrBr@rrs I.rBrceZdZdZddZy) ContinueStmtrSc$|j|Sr>)visit_continue_stmtrs r@rzContinueStmt.acceptrFrBNrrrSrBr@rrs I1rBrceZdZdZddZy)PassStmtrSc$|j|Sr>)visit_pass_stmtrs r@rzPassStmt.acceptrrBNrrrSrBr@rrs I-rBrcPeZdZUdZdZded<ded<ded<d fd Zd d ZxZS) IfStmtrnrrN list[Block]rrrocLt|||_||_||_yr>rqrrs r@rAzIfStmt.__init__rsrBc$|j|Sr>) visit_if_stmtrs r@rz IfStmt.accept $$T**rB)rNrrrrorrIrJrrvrs@r@rrs)-I2N  # +rBrcFeZdZUdZdZded<ded<dfd ZddZxZS) RaiseStmt)rN from_exprrrNrc>t|||_||_yr>)rrArNr)r?rNrrs r@rAzRaiseStmt.__init__s  "rBc$|j|Sr>)visit_raise_stmtrs r@rzRaiseStmt.acceptr&rB)rNrrrrIrJrrvrs@r@rrs%%I*N   # .rBrceZdZUdZdZded<ded<ded<ded <d ed <d ed <d ed< dfd ZddZxZS)TryStmt)rr_varshandlersro finally_bodyis_starrrlist[Expression | None]r_list[NameExpr | None]rrrrrorrrct|||_||_||_||_||_||_d|_yr) rrArrr_rrorr)r?rrr_rrorrs r@rAzTryStmt.__init__1sB      "( rBc$|j|Sr>)visit_try_stmtrs r@rzTryStmt.acceptCrrB)rrrrr_rrrrorrrrIrJrrvrs@r@rr"s]IbN K ""  M$'     # $,rBrceZdZUdZdZded<ded<ded<d ed <d ed <d ed< d dfd ZddZxZS)WithStmt)rNrFr.analyzed_typesrr~)rNrFrrrNlist[Lvalue | None]rFrr.rrrrrr~cvt|||_||_||_g|_||_d|_yr)rrArNrFr.rrr~)r?rNrFr target_typers r@rAzWithStmt.__init__Us<   *   rBc$|j|Sr>)visit_with_stmtrs r@rzWithStmt.acceptdrrBr>) rNrrFrrrrrrIrJrrvrs@r@rrGsn[I/N  ++)) KN/3  $   ,   -rBrcxeZdZUdZdZded<ded<ded<d ed <d ed < dfd ZddZxZS) MatchStmt)subject subject_dummypatternsguardsbodies)rrrrrrzNameExpr | Noner list[Pattern]rrrrrct|t|t|cxk(rt|k(sJJ||_d|_||_||_||_yr>)rrArrrrrr)r?rrrrrs r@rAzMatchStmt.__init__ssY 8}F :s6{::::: !    rBc$|j|Sr>)visit_match_stmtrs r@rzMatchStmt.acceptr&rB) rrrrrrrrrIrJrrvrs@r@rrhseLI@N "" ##     (     .rBrcdeZdZUdZdZded<ded<ded<d ed <d ed <dfd ZddZxZS) TypeAliasStmt)rrrr^ alias_node)rrrNameExprrlist[TypeParam]r LambdaExprrrr^TypeAlias | Nonercht|||_||_||_d|_d|_yr)rrArrrr^r)r?rrrrs r@rAzTypeAliasStmt.__init__s2  " ',$rBc$|j|Sr>)visit_type_alias_stmtrs r@rzTypeAliasStmt.acceptrUrB)rrrrrrrIrJrrvrs@r@rrs4WI3N N !!  3rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) IntExprzInteger literalrrErc0t|||_yr>rrArr?rrs r@rAzIntExpr.__init__r=rBc$|j|Sr>)visit_int_exprrs r@rzIntExpr.acceptrrB)rrErIrJrrrs@r@rrsIN J,rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) StrExprzString literalrrrc0t|||_yr>rrs r@rAzStrExpr.__init__r=rBc$|j|Sr>)visit_str_exprrs r@rzStrExpr.acceptrrBrrrIrJrrrs@r@rrsIN J,rBrc&td|DS)Nc3<K|]}t|tywr>)rDrrts r@rvz"is_StrExpr_list..s9Tz$(9rw)rx)seqs r@is_StrExpr_listrs 9S9 99rBc@eZdZUdZdZdZded<dfd ZddZxZ S) BytesExprz Bytes literalrrrc0t|||_yr>rrs r@rAzBytesExpr.__init__r=rBc$|j|Sr>)visit_bytes_exprrs r@rzBytesExpr.acceptr&rBrrrrs@r@rrs!IN J.rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) FloatExprz Float literalrfloatrc0t|||_yr>rrs r@rAzFloatExpr.__init__r=rBc$|j|Sr>)visit_float_exprrs r@rzFloatExpr.acceptr&rB)rrrIrJrrrs@r@rrsIN L.rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) ComplexExprzComplex literalrrrc0t|||_yr>rrs r@rAzComplexExpr.__init__r=rBc$|j|Sr>)visit_complex_exprrs r@rzComplexExpr.accept))$//rB)rrrIrJrrrs@r@rrsIN N0rBrceZdZdZdZddZy) EllipsisExprzEllipsis (...)rSc$|j|Sr>)visit_ellipsisrs r@rzEllipsisExpr.accept rrBNrrrSrBr@rrsI,rBrcJeZdZUdZdZdZded<ded<d fd Zd dZxZ S) StarExprzStar expression)rNvalidrrNrrc>t|||_d|_yr)rrArNrrQs r@rAzStarExpr.__init__s   rBc$|j|Sr>)visit_star_exprrs r@rzStarExpr.accept"rrBrVrrrs@r@rrs%!I&N  K-rBrc`eZdZdZdZdfd ZeddZejddZxZ S) RefExprz,Abstract base class for name-like constructs)r~noder is_new_defis_inferred_defis_alias_rvalue type_guardtype_isct|d|_d|_d|_d|_d|_d|_d|_d|_ yr!) rrAr~rrrrrrr rs r@rAzRefExpr.__init__4sJ  $ '+  %$26/3 rBc|jSr>rrs r@rzRefExpr.fullnameJrrBc||_yr>rr&s r@rzRefExpr.fullnameNr'rBrrr5) rNrOrPrQrRrArrrWrrs@r@rr&s>6 I4,__rBrc<eZdZdZdZdZdfd ZddZd dZxZ S) rzOName expression This refers to a local name, global name or a module. )ris_special_form)rrc>t|||_d|_yr)rrArr)r?rrs r@rAzNameExpr.__init__]s  $rBc$|j|Sr>)visit_name_exprrs r@rzNameExpr.acceptcrrBcJd|)NzSerializing NameExpr: rSrs r@rzNameExpr.serializefs5.tf55urB)rrrIrJrr) rNrOrPrQrRrrArrrrs@r@rrSs# ,I%N% -6rBrc4eZdZdZdZdZdfd ZddZxZS) MemberExprzMember access expression x.y)rNrdef_var)rNrrcLt|||_||_d|_yr>)rrArNrr)r?rNrrs r@rAzMemberExpr.__init__qs%   $( rBc$|j|Sr>)visit_member_exprrs r@rzMemberExpr.acceptyr rB)rNrrrrIrJr rNrOrPrQrRrrArrrs@r@rrjs&+I-N(/rBrcPeZdZdZdZdZdZdZdZd ddZ d ddZ dd Z dd Z dd Z y )rrrXrZr\cH|tk(xs|tk(xs |xr |tk(Sr>)rrARG_STARr?stars r@ is_positionalzArgKind.is_positionals$wP$'/Pd6Otx?OPrBcH|tk(xs|tk(xs |xr |tk(Sr>) ARG_NAMED ARG_NAMED_OPT ARG_STAR2rs r@is_namedzArgKind.is_nameds&y YDM$9Yd>XtyGXYrBc*|tk(xs |tk(Sr>)rr#rs r@ is_requiredzArgKind.is_requiredsw3$)"33rBc*|tk(xs |tk(Sr>)rr$rs r@ is_optionalzArgKind.is_optionalsw7$-"77rBc*|tk(xs |tk(Sr>)rr%rs r@rzArgKind.is_starsx449#44rBNr)r rrIrr)rNrOrPrrrr#r%r$r!r&r(r*rrSrBr@rr~s=GGHIIMQZ485rBrrrrr#r%r$rcNeZdZdZdZdZ d dfd ZddZxZS) CallExprzCall expression. This can also represent several special forms that are syntactically calls such as cast(...) and None # type: .... )calleeargsrrr)r.r/rrct||sdgt|z}||_||_||_||_||_yr>)rrArr.r/rrr)r?r.r/rrrrs r@rAzCallExpr.__init__sH T*I  "+4! rBc$|j|Sr>)visit_call_exprrs r@rzCallExpr.acceptrrBr>) r.rr/rr list[ArgKind]rzlist[str | None]rrrIrJrrrs@r@r-r-s^ IIAN'+ !!!! ! $ ! $ ! !*-rBr-c<eZdZUdZdZded<dfd ZddZxZS) YieldFromExprrMrrNc0t|||_yr>rPrQs r@rAzYieldFromExpr.__init__rRrBc$|j|Sr>)visit_yield_from_exprrs r@rzYieldFromExpr.acceptrUrBrVrrvrs@r@r5r5sIN 3rBr5c<eZdZUdZdZded<dfd ZddZxZS) YieldExprrMrrNc0t|||_yr>rPrQs r@rAzYieldExpr.__init__rRrBc$|j|Sr>)visit_yield_exprrs r@rzYieldExpr.acceptr&rBrrrvrs@r@r:r:sIN .rBr:c^eZdZUdZdZdZded<ded<ded<d ed <d fd Zdd ZxZ S) IndexExprzaIndex expression x[y]. Also wraps type application such as List[int] as a special form. )basery method_typer)r@ryrr@ryrrAz&TypeApplication | TypeAliasExpr | NonercZt|||_||_d|_d|_yr>)rrAr@ryrAr)r?r@ryrs r@rAzIndexExpr.__init__s+    rBc$|j|Sr>)visit_index_exprrs r@rzIndexExpr.accept r&rB)r@rryrrIrJrrrs@r@r?r?s8 =I&N  ''54.rBr?cTeZdZUdZdZdZded<ded<ded <d fd Zd d ZxZ S) UnaryExprzUnary operation)rfrNrA)rfrNrrfrrNrrAcLt|||_||_d|_yr>)rrArfrNrA)r?rfrNrs r@rAzUnaryExpr.__init__ s$  rBc$|j|Sr>)visit_unary_exprrs r@rzUnaryExpr.accept r&rB)rfrrNrrIrJrrrs@r@rFrF s+-I#N G '' .rBrFc4eZdZdZdZdZdfd ZddZxZS)AssignmentExprz5Assignment expressions in Python 3.8+, like "a := 2".)rFrc>t|||_||_yr>)rrArFr)r?rFrrs r@rAzAssignmentExpr.__init__# s   rBc$|j|Sr>)visit_assignment_exprrs r@rzAssignmentExpr.accept( rUrB)rFrrrrIrJrrrs@r@rKrK s?#I(N 3rBrKceZdZUdZdZdZded<ded<ded<d ed <d ed <d ed <ded< d dfd ZddZxZ S)OpExprz^Binary operation. The dot (.), [] and comparison operators have more specific nodes. )rfleftrightrA right_alwaysright_unreachabler)rQrfrRrrfrrQrRrrArrSrTTypeAliasExpr | Nonerct|||_||_||_d|_d|_d|_||_yr) rrArfrQrRrArSrTr)r?rfrQrRrrs r@rAzOpExpr.__init__J sD   !!&  rBc$|j|Sr>) visit_op_exprrs r@rz OpExpr.acceptV rrBr>) rfrrQrrRrrrUrIrJrrrs@r@rPrP, sx I-N G  ''""^b ! !' !0: !FZ !  !+rBrPc\eZdZUdZdZdZded<ded<ded <d fd Zdd Zdd Z xZ S)ComparisonExprz+Comparison expression (e.g. a < b > c < d).) operatorsoperands method_types)r\r[r9r[rr\zlist[mypy.types.Type | None]r]cLt|||_||_g|_yr>)rrAr[r\r])r?r[r\rs r@rAzComparisonExpr.__init__f s$ "  rBc#Kt|jD])\}}||j||j|dzf+yw)zzIf this comparison expr is "a < b is c == d", yields the sequence ("<", a, b), ("is", b, c), ("==", c, d) rXN)rLr[r\)r?rPoperators r@pairwisezComparisonExpr.pairwisel sI%T^^4 CKAxDMM!,dmmAE.BB B CsAAc$|j|Sr>)visit_comparison_exprrs r@rzComparisonExpr.accepts rUrB)r[r9r\rrIrJ)rIz,Iterator[tuple[str, Expression, Expression]]r) rNrOrPrQrRrrlrArarrrs@r@rZrZZ s259I.N.. C3rBrZcdeZdZUdZdZdZded<ded<ded< d fd Zd dZxZ S) SliceExprznSlice expression (e.g. 'x:y', 'x:', '::2' or ':'). This is only valid as index in index expressions. ) begin_index end_indexstriderrfrgrhcLt|||_||_||_yr>)rrArfrgrh)r?rfrgrhrs r@rAzSliceExpr.__init__ s& &" rBc$|j|Sr>)visit_slice_exprrs r@rzSliceExpr.accept r&rB)rfrrgrrhrrIrJrrrs@r@rerew sV 7I;N""   & % "   .rBrecJeZdZUdZdZdZded<ded<d fd Zd dZxZ S) CastExprz!Cast expression cast(type, expr).rNrrrNmypy.types.Typerc>t|||_||_yr>rrArNrr?rNrers r@rAzCastExpr.__init__    rBc$|j|Sr>)visit_cast_exprrs r@rzCastExpr.accept rrBrNrrerorIrJrrrs@r@rmrm s&+ I%N   -rBrmcJeZdZUdZdZdZded<ded<d fd Zd dZxZ S) AssertTypeExprz1Represents a typing.assert_type(expr, type) call.rnrrNrorc>t|||_||_yr>rqrrs r@rAzAssertTypeExpr.__init__ rsrBc$|j|Sr>)visit_assert_type_exprrs r@rzAssertTypeExpr.accept --d33rBrvrrrs@r@rxrx s&; I%N   4rBrxcneZdZUdZdZdZded<ded<ded< d d fd Zd d ZxZ S) RevealExprzGReveal type expression reveal_type(expr) or reveal_locals() expression.)rNr~ local_nodes is_importedrrNrEr~list[Var] | NonercZt|||_||_||_||_yr>)rrArNr~rr)r?r~rNrrrs r@rAzRevealExpr.__init__ s.   &&rBc$|j|Sr>)visit_reveal_exprrs r@rzRevealExpr.accept r rB)NNF) r~rErNrrrrrrIrJrrrs@r@r~r~ sfQ>ICN  I!! #'(,! ' '  '& '  '  '/rBr~cTeZdZUdZdZdZded<ded<ded <d fd Zd d ZxZ S) SuperExprzExpression super().name)rr/call)rrr/rrTypeInfo | Noner/r-rcLt|||_||_d|_yr>)rrArrr/)r?rrrs r@rAzSuperExpr.__init__ s#    rBc$|j|Sr>)visit_super_exprrs r@rzSuperExpr.accept r&rB)rrrr-rIrJrrrs@r@rr s*!(I-N I  N .rBrc>eZdZdZdZeddZd dZd dZd dZ y) rzLambda expression)rrrrctSr>)r~rs r@rzLambdaExpr.name srBc||jjd}t|tsJ|j}|J|S)z/Return the expression (the body) of the lambda.rH)rrDrrN)r?rrNs r@rNzLambdaExpr.expr s>iinnR #z***xx rBc$|j|Sr>)visit_lambda_exprrs r@rzLambdaExpr.accept r rBcyrrSrs r@rszLambdaExpr.is_dynamic srBNr)rIrrr) rNrOrPrQrrrrNrrsrSrBr@rr s+DN /rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) ListExprzList literal expression [...].r>rr>c0t|||_yr>rrAr>rIs r@rAzListExpr.__init__ r=rBc$|j|Sr>)visit_list_exprrs r@rzListExpr.accept rrBr>rrIrJrrrs@r@rr s (IN -rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) DictExprz0Dictionary literal expression {key: value, ...}.r*list[tuple[Expression | None, Expression]]r>c0t|||_yr>rrIs r@rAzDictExpr.__init__ r=rBc$|j|Sr>)visit_dict_exprrs r@rzDictExpr.accept! rrB)r>rrIrJrrrs@r@rr s :IN 55-rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) TupleExprzXTuple literal expression (..., ...) Also lvalue sequences (..., ...) and [..., ...]rrr>c0t|||_yr>rrIs r@rAzTupleExpr.__init__0 r=rBc$|j|Sr>)visit_tuple_exprrs r@rzTupleExpr.accept4 r&rBrrrrs@r@rr% s$7IN .rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) SetExprz$Set literal expression {value, ...}.rrr>c0t|||_yr>rrIs r@rAzSetExpr.__init__A r=rBc$|j|Sr>)visit_set_exprrs r@rzSetExpr.acceptE rrBrrrrs@r@rr8 s .IN ,rBrceZdZUdZdZdZded<ded<ded <d ed <d ed < dfd ZddZxZ S) GeneratorExprzGGenerator expression ... for ... in ... [ for ... in ... ] [ if ... ].) left_expr sequences condlistsr~indices)rrrrrrrrlist[list[Expression]]r list[bool]r~r`rcht|||_||_||_||_||_yr>)rrArrrrr~)r?rrrrr~rs r@rAzGeneratorExpr.__init__V s3 """   rBc$|j|Sr>)visit_generator_exprrs r@rzGeneratorExpr.accepte ++D11rB) rrrr`rrrrr~rrIrJrrrs@r@rrI srQNIGN%%  ! ! !$ ! * !  !  !2rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) ListComprehensionz,List comprehension (e.g. [x + 1 for x in a]) generatorrrc0t|||_yr>rrArr?rrs r@rAzListComprehension.__init__r  "rBc$|j|Sr>)visit_list_comprehensionrs r@rzListComprehension.acceptv s//55rBrrrIrJrrrs@r@rri s 6I#N#6rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) SetComprehensionz+Set comprehension (e.g. {x + 1 for x in a})rrrc0t|||_yr>rrs r@rAzSetComprehension.__init__ rrBc$|j|Sr>)visit_set_comprehensionrs r@rzSetComprehension.accept s..t44rBrrrrs@r@rrz s 5I#N#5rBrceZdZUdZdZdZded<ded<ded<d ed <d ed <d ed< dfd ZddZxZ S)DictionaryComprehensionz3Dictionary comprehension (e.g. {k: v for k, v in a})keyrrrr~r)rrrrrrrrrrrrrr~r`rcvt|||_||_||_||_||_||_yr>)rrArrrrrr~)r?rrrrrr~rs r@rAz DictionaryComprehension.__init__ s:  ""   rBc$|j|Sr>)visit_dictionary_comprehensionrs r@rzDictionaryComprehension.accept rkrB)rrrrrr`rrrrr~rrIrJrrrs@r@rr s=QIJN O %% ! !! ! $ ! * !! !")rrArrr)r?rrrrs r@rAzConditionalExpr.__init__ s#   "rBc$|j|Sr>)visit_conditional_exprrs r@rzConditionalExpr.accept r|rB)rrrrrrrIrJrrrs@r@rr s,50I5N  # 4rBrcJeZdZUdZdZdZded<ded<d fd Zd dZxZ S) TypeApplicationz Type application expr[type, ...])rNr_rrNrr_c>t|||_||_yr>)rrArNr_)r?rNr_rs r@rAzTypeApplication.__init__ s   rBc$|j|Sr>)visit_type_applicationrs r@rzTypeApplication.accept r|rB)rNrr_rrIrJrrrs@r@rr s&*!I&N    4rBr INVARIANT COVARIANT CONTRAVARIANTVARIANCE_NOT_READYceZdZUdZdZded<ded<ded<ded<d ed <ed d f dfd ZeddZ eddZ xZ S)TypeVarLikeExprzBase class for TypeVarExpr, ParamSpecExpr and TypeVarTupleExpr. Note that they are constructed by the semantic analyzer. )rrrrvariance is_new_stylerrrrorrrErFrHczt||||_||_||_||_||_||_yN)r9)rrArrrrrr) r?rrrrrrr9rs r@rAzTypeVarLikeExpr.__init__ sA d# !&   (rBc|jSr>rrs r@rzTypeVarLikeExpr.name rrBc|jSr>rrs r@rzTypeVarLikeExpr.fullname rrB)rrrrrrorrorrErrr9rErIrJr) rNrOrPrQrRrlrrArrrrrs@r@rr s ]I JN!  M"")))% ) ! )  ))) )$rBrSYMBOL_NODE_EXPRESSION_TYPESceZdZUdZdZdZded<eddf dfd Zdd Z dd Z e dd Z dd Z e dd ZxZS) TypeVarExprarType variable expression TypeVar(...). This is also used to represent type variables in symbol tables. A type variable is not valid as a type unless bound in a TypeVarLikeScope. That happens within: 1. a generic class that uses the type variable as a type argument or 2. a generic function that refers to the type variable in its signature. )r)rrrrrrFrHc @t ||||||||||_yr)rrAr) r?rrrrrrrr9rs r@rAzTypeVarExpr.__init__/ s) xgx\`a rBc$|j|Sr>)visit_type_var_exprrs r@rzTypeVarExpr.accept= rFrBcd|j|j|jDcgc]}|jc}|jj|j j|j dScc}w)Nr)rrrrrrr)rrrrrrr)r?ts r@rzTypeVarExpr.serialize@ sc#JJ.2kk:q{{}:++557||--/   ;sA? c .|ddk(sJt|d|d|dDcgc]!}tjj|#c}tjj|dtjj|d|dScc}w) Nrrrrrrrr)rrr_r`)rrrs r@rzTypeVarExpr.deserializeK sH~... L  59(^ DTZZ ( ( + D JJ ' '](; < JJ ' 'Y 8      Es&B cht|tt||jt||jt j j||j|jj||jj|t||jyr>)r- TYPE_VAR_EXPRr)rrrr_r1rrrrr%rrs r@rzTypeVarExpr.writeW st$ &$ #$' ""45 t$ 4 $ &rBc tt|t|tjj |tjj |tjj |t |Sr>)rrrr_read_type_list read_typerrs r@rzTypeVarExpr.read` sZ TN TN JJ % %d + JJ  & JJ  & TN   rB)rrrrrrrrorrorrErrr9rErIrJrr)rrVrIrr)rrrIr)rNrOrPrQrRrrlrrArrrrrrrrs@r@rr s IAN "!""   &  %  !      1      '  rBrcPeZdZdZdZd dZd dZed dZd dZ ed dZ y) ParamSpecExprrSrrrc$|j|Sr>)visit_paramspec_exprrs r@rzParamSpecExpr.acceptq rrBcd|j|j|jj|jj|j dS)Nr)rrrrrr)rrrrrrrs r@rzParamSpecExpr.serializet sF%JJ++557||--/   rBc |ddk(sJt|d|dtjj|dtjj|d|dS)Nrrrrrrr)rrr_r`rs r@rzParamSpecExpr.deserialize~ seH~000 L   JJ ' '](; < JJ ' 'Y 8     rBct|tt||jt||j|j j ||jj |t||jyr>) r-PARAM_SPEC_EXPRr)rrrrrr%rrs r@rzParamSpecExpr.write s\$($ #$' t$ 4 $ &rBc tt|t|tjj |tjj |t |Sr>)rrrr_rrrs r@rzParamSpecExpr.read sH TN TN JJ  & JJ  & TN   rBNrr)rrVrIrr)rrrIr) rNrOrPrRrrrrrrrrSrBr@rrl sCI7N2   '  rBrceZdZUdZdZded<dZeddf d fd ZddZ dd Z e dd Z dd Z e dd ZxZS)TypeVarTupleExprz1Type variable tuple expression TypeVarTuple(...).tuple_fallbackmypy.types.InstancerFrHc @t ||||||||||_yr)rrAr) r?rrrrrrrr9rs r@rAzTypeVarTupleExpr.__init__ s* xgx\`a,rBc$|j|Sr>)visit_type_var_tuple_exprrs r@rzTypeVarTupleExpr.accept rZrBcd|j|j|jj|jj|j j|j dS)Nr)rrrrrrr)rrrrrrrrs r@rzTypeVarTupleExpr.serialize sX(JJ++557"11;;=||--/   rBc |ddk(sJt|d|dtjj|dtjjj |dtjj|d|dS) Nrrrrrrrr)rrr_r`Instancerrs r@rzTypeVarTupleExpr.deserialize sH~!3333 L   JJ ' '](; < JJ   + +D1A,B C JJ ' 'Y 8     rBcJt|t|jj|t ||j t ||j |jj||jj|t||jyr>) r-TYPE_VAR_TUPLE_EXPRrrr)rrrrr%rrs r@rzTypeVarTupleExpr.write sq$+, !!$'$ #$' t$ 4 $ &rBc nt|tjjk(sJtjjj |}t t|t|tjj||tjj|t|Sr>) r#rr_INSTANCErrrrrr)rrfallbacks r@rzTypeVarTupleExpr.read s~!4!4444::&&++D1 TN TN JJ  &  JJ  & TN   rB)rrrrrrorrrrorrErrr9rErIrJrr)rrVrIrr)rrrIr)rNrOrPrQrRrlrrrArrrrrrrrs@r@rr s; I''7N"" - - -% - , - ! - - - -  -7      '    rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) TypeAliasExprzType alias expression (rvalue).rrrc0t|||_yr>)rrAr)r?rrs r@rAzTypeAliasExpr.__init__ rRrBc$|j|Sr>)visit_type_alias_exprrs r@rzTypeAliasExpr.accept rUrB)rrrIrJrrrs@r@r r  s)IN O3rBr cLeZdZUdZdZdZded<ded<d d fd Zd d ZxZ S) NamedTupleExprz:Named tuple expression namedtuple(...) or NamedTuple(...).)r/is_typedr/rr/rrc>t|||_||_yr>)rrAr/r)r?r/rrs r@rAzNamedTupleExpr.__init__ s    rBc$|j|Sr>)visit_namedtuple_exprrs r@rzNamedTupleExpr.accept rUrBr)r/rrrrIrJrrrs@r@rr s&D$IN NN! 3rBrc@eZdZUdZdZdZded<dfd ZddZxZ S) TypedDictExprz%Typed dict expression TypedDict(...).rrr/c0t|||_yr>)rrAr/)r?r/rs r@rAzTypedDictExpr.__init__ rRrBc$|j|Sr>)visit_typeddict_exprrs r@rzTypedDictExpr.accept rrB)r/rrIrJrrrs@r@rr s!/IN N2rBrcTeZdZUdZdZdZded<ded<ded<d fd Zd d ZxZ S) EnumCallExprz5Named tuple expression Enum('name', 'val1 val2 ...').)r/r>rrr/r9r>rrcLt|||_||_||_yr>)rrAr/r>r)r?r/r>rrs r@rAzEnumCallExpr.__init__) s#    rBc$|j|Sr>)visit_enum_call_exprrs r@rzEnumCallExpr.accept/ rrB)r/rr>r9rrrIrJrrrs@r@rr s-?+I0N N  ## 2rBrc<eZdZUdZdZded<dfd ZddZxZS) PromoteExprz2Ducktype class decorator expression _promote(...).rmypy.types.ProperTyperc0t|||_yr>)rrAr)r?rrs r@rAzPromoteExpr.__init__: rRrBc$|j|Sr>)visit__promote_exprrs r@rzPromoteExpr.accept> rFrB)rr%rIrJr) rNrOrPrQrRrlrArrrs@r@r$r$3 s<I 1rBr$cheZdZUdZdZdZded<ded<ded< d fd Zd d ZxZ S) NewTypeExprz NewType expression NewType(...).)rold_typer/rrrr+rr/cRt|||||_||_d|_y)N)r9r:)rrArr+r/)r?rr+r9r:rs r@rAzNewTypeExpr.__init__O s, d62    rBc$|j|Sr>)visit_newtype_exprrs r@rzNewTypeExpr.acceptW rrB) rrr+rr9rEr:rErIrJrrrs@r@r*r*B sS*,I1N I$$ #9ADNQ 0rBr*c@eZdZUdZdZdZded<dfd ZddZxZ S) AwaitExprzAwait expression (await ...).rMrrNc0t|||_yr>rPrQs r@rAzAwaitExpr.__init__d rRrBc$|j|Sr>)visit_await_exprrs r@rzAwaitExpr.accepth r&rBrVrrrs@r@r0r0[ s 'IN .rBr0cfeZdZUdZdZded<ded< d dd d fd Zdd Zdd ZxZ S)TempNodezTemporary dummy node used during type checking. This node is not present in the original program; it is just an artifact of the type checker implementation. It only represents an opaque node with some fixed type. )rno_rhsrorrr6N)contextct|||_||_|#|j|_|j |_yy)zJConstruct a dummy node; optionally borrow line/column from context object.N)rrArr6r9r:)r?rer6r7rs r@rAzTempNode.__init__~ s?     DI!..DK rBcJd|jt|jfzS)NzTempNode:%d(%s))r9rrrs r@r zTempNode.__repr__ s DIIs499~#>>>rBc$|j|Sr>)visit_temp_noders r@rzTempNode.accept rrBr)reror6rr7zContext | NonerIrJrr) rNrOrPrQrRrlrAr rrrs@r@r5r5o sX#I  L49 )W[ )" ),0 )FT )  )?-rBr5> rQr7__dict__rArRrO __weakref__rl__subclasshook____class_getitem____abstractmethods__EXCLUDED_PROTOCOL_ATTRIBUTES>_order__ignore_ __order__EXCLUDED_ENUM_ATTRIBUTESceZdZUdZdZded<ded<ded<ded <d ed <d ed <d ed<d ed<ded<ded<ded<d ed<d ed<d ed<ded<ded<ded<ded<ded <d!ed"<d ed#<d ed$<d ed%<ded&<d ed'<d!ed(<d)ed*<ded+<d,ed-<d ed.<d/ed0<d ed1<d ed2<d3ed4<d5ed6<d7ed8<d9ed:<d ed;<ded?<gd@ZdAedB<d`fdC ZdadDZe dbdEZ e dbdFZ dcdGZ dddHZ dedIZe dfdJZe dfdKZdgdLZdbdMZdcdNZdhdOZdidPZdjdQZdkdRZdSdTdldUZdmdVZdndWZdodXZdpdYZdbdZZ dqd[Zdrd\Ze dsd]Z!dtd^Z"e dud_Z#xZ$S)vraThe type structure of a single class. Each TypeInfo corresponds one-to-one to a ClassDef, which represents the AST of the class. In type-theory terms, this is a "type constructor", and if the class is generic then it will be a type constructor of higher kind. Where the class is used in an actual type, it's in the form of an Instance, which amounts to a type application of the tycon to the appropriate number of arguments. )+r module_namedefnmro _mro_refsbad_mror*is_disjoint_basedeclared_metaclassmetaclass_typer is_abstract is_protocolruntime_protocolabstract_attributesdeletable_attributesslotsassumingassuming_proper inferringis_enumfallback_to_anymeta_fallback_to_anyrhas_param_spec_typebases_promote tuple_type special_aliasis_named_tupletypeddict_type is_newtypeis_intersectionmetadata alt_promotehas_type_var_tuple_typetype_var_tuple_prefixtype_var_tuple_suffix self_typerr1rAtype_object_typerrrGrrHlist[TypeInfo]rIzlist[str] | NonerJrrKr*rLmypy.types.Instance | NonerMrNrrrOrPrQzlist[tuple[str, int]]rRr9rSzset[str] | NonerTz5list[tuple[mypy.types.Instance, mypy.types.Instance]]rUrVzlist[mypy.types.Instance]rWrXrYrZrr[r\zlist[mypy.types.ProperType]r]rezmypy.types.TupleType | Noner^r`zmypy.types.TypedDictType | Nonerarbrczdict[str, JsonDict]rdrr_zmypy.types.TypeVarType | NonerizDataclassTransformSpec | Nonerr1rErArrj) rOrXrYrZr`rbrPrQr*rLrcr FLAGSct||j|_||_||_||_g|_d|_d|_ g|_ g|_ d|_ d|_ d|_d|_d|_g|_g|_d|_g|_g|_g|_d|_d|_d|_d|_|j7d|_d|_d|_d|_d|_ g|_!d|_"d|_#d|_$d|_%d|_&d|_'d|_(i|_)d|_*d|_+d|_,d|_-d|_.y)zInitialize a TypeInfo.FN)/rrArrrrHrGrr[rfr\rIrJrKrMrNrOrRrSrTrUrVrWrPrQrgrh add_type_varsr*rLrXrYrZr]rer^r_r`rarbrcrdrirr1rArj)r?rrHrGrs r@rAzTypeInfo.__init__ sc   &#( ',$  "&" #% $&!  !  %15"15"  % $$)! !#"$ (,%"' $rBcd|_|jjrt|jjD]\}}t |t j jrd|_t |t j jrF|jrJd|_||_ t|jj|z dz |_ |jj|jyy)NFTrX)rfrHrrLrDrr_ ParamSpecTyper[TypeVarTupleTypergrrhappendr)r?rPvds r@rozTypeInfo.add_type_vars s',$ 99  "499#6#67 /2b$**":":;/3D,b$**"="=>#;;;;37D012D.14TYY5H5H1IA1MPQ1QD.%%bgg. / rBc.|jjS)z Short name.)rHrrs r@rz TypeInfo.name syy~~rBc|jSr>rrs r@rzTypeInfo.fullname rrBc2t|jdkDS)z7Is the type generic (i.e. does it have type variables)?r)rrrs r@r+zTypeInfo.is_generic s4>>"Q&&rBch|jD]#}|jj|}|s!|cSyr>)rIrr)r?rrns r@rz TypeInfo.get s488 C d#A rBcJ|jD]}||jvs|cSyr>)rIr)r?rrs r@get_containing_type_infoz!TypeInfo.get_containing_type_info s+88 Csyy   rBcXt}|jsJd|jddD]q}|js|jj D]E\}}t |j tttfr,|tvr5|j|Gst|S)Nz?This property can be only accessed after MRO is (re-)calculatedrH) rrIrPrr>rDrrrrrAaddr)r?membersr@rrs r@protocol_memberszTypeInfo.protocol_members s ExxZZZxHHSbM &D"&**"2"2"4&JD$!$))ih-OP ;; KK% & &grBcTg}|jjD]\}}t|jtr9t d|jj DsH|j|Zt|jttfs{|tvst|s|jdrt|jtr|jjstjj!|jj"}t|tjj$r|j'r=t|tjj(r|j"j*dk(rw|j||S)Nc3ZK|]#}t|tr|jdk(%yw)z enum.memberN)rDrr)rurs r@rvz(TypeInfo.enum_members..s+!#w/LLM1s)+__zenum.nonmember)rr>rDrr:anyrNrsrrrEr/rrrr_get_proper_typerr is_type_objrr)r?r~rsymres r@ enum_memberszTypeInfo.enum_members s4))+- %ID# #((I."xx22 NN4(CHHsHo644 t,chh,8866 **44SXX]]CC"3 (?(?@IZ"3 (;(;<HH--1AA t$[- %\rBcB|j|}|r|St|r>)rKeyError)r?rrys r@ __getitem__zTypeInfo.__getitem__+s! HHTN H4. rBc"d|jdS)Nz )rDFakeInfors r@__bool__zTypeInfo.__bool__5sdH---rBc(|j|duSr>)rr s r@has_readable_memberzTypeInfo.has_readable_member;sxx~T))rBc|jD]S}||jvs|j|j}t|tr|cSt|t r|cSyyr>)rIrrrDrr:)r?rrrs r@ get_methodzTypeInfo.get_method>s[88 Csyy yy++d$9:Ki0K rBc|j}||jjds|S|jdk(r tj j |gS|}|jddD]}|j}| |j||}#|jj|jjrS|jj|jjr|}d}|S|S)N builtins.typerX) rMrhas_baserrr_rrIr)r?declaredwinner super_class super_metas r@calculate_metaclass_typez!TypeInfo.calculate_metaclass_typeJs**   (>(>(OO >>_ ,::&&tR0 088AB< K$77J!Z__%<~#{{##JOO$<$<='' (<(<=#F  !   rBcX|j}||jjdsy|jdk(ry|}|g}n(d|jjd|jdg}|j ddD].}|j}| |j|9|}|j d|jjd|jdZ|jj|jjr|jj|jjr9|}|j d|jjd|jdd|jjd|jd}dj|d|cSy)Nr"z" (metaclass of "z")rXz > z conflicts with )rMrrrrrIrsjoin)r?rrresolution_stepsrrconflicts r@explain_metaclass_conflictz#TypeInfo.explain_metaclass_conflictds**   (>(>(O >>_ ,  ! "#HMM$:$:#;;LT]]O[] ^_ 88AB< OK$77J!Z__%<~# '' ,,-->{?S?S>TTVW{{##JOO$<$<='' (<(<=# '' ,,-->{?S?S>TTVW:??3344EkFZFZE[[]^Hjj!1233CH:N N) O,rBF)precisecl|jdxs"|jdk(xs|jxr| S)Nrz abc.ABCMeta)rrrY)r?rs r@ is_metaclasszTypeInfo.is_metaclasss9 MM/ * 6}} - 6$$4W rBcH|jD]}|j|k(syy)zReturn True if type has a base type with the specified name. This can be either via extension or via implementation. TF)rIr)r?rrs r@rzTypeInfo.has_bases+ 88 C||x' rBcT|jDcgc]}|jc}Scc}w)zXReturn a direct base classes. Omit base classes of other base classes. )r\r)r?r@s r@direct_base_classeszTypeInfo.direct_base_classess '+jj1d 111s%c||_tj|}|js||_y|j|j_d|j_y)z.Update tuple_type and special_alias as needed.N)r^rfrom_tuple_typer_rF _is_recursiver?realiass r@update_tuple_typezTypeInfo.update_tuple_typesJ))$/!!!&D (- D   %/3D   ,rBc||_tj|}|js||_y|j|j_d|j_y)z2Update typeddict_type and special_alias as needed.N)rarfrom_typeddict_typer_rFrrs r@update_typeddict_typezTypeInfo.update_typeddict_typesK!--d3!!!&D (- D   %/3D   ,rBct}|jtjj |tj j |S)zzReturn a string representation of the type. This includes the most important information about the type. r)str_conv type_str_conv)r.dumprrrr_TypeStrVisitorrs r@rzTypeInfo.__str__sK )yy\\))'):**33G3D  rBc d}dfd dj|z}|jr(ddj fd|jDd}djdjfd |jD}g}t |j D]}|j|j |jz}|j |j} t| tr%| jr|d  | jdz }|j|d |jd||d |fg} |jr%| jd  |jd|jr%| jd |jdtj j#| |S)z5Return a string dump of the contents of the TypeInfo.rc&|jSr>)r)rers r@type_strzTypeInfo.dump..type_strs::m, ,rBrzBases(z, c3.K|] }|ywr>rS)rur@rs r@rvz TypeInfo.dump..s%Lhtn%Ls)zMro({})c3ZK|]"}|jj|z$ywr>)r format_id)rurQrs r@rvz TypeInfo.dump..s%T4dmmh&8&8&>>Ts(+ (zName(NameszDeclaredMetaclass(zMetaclassType()r)rerorIr)rr\rformatrIrrrrDrrrsrrMrNrr dump_tagged) r?rrr@headrIrr descriptionrr>rs `` @r@rz TypeInfo.dumps  -H..t44 ::DII%L%LLMQOD IIT488T T 4::& &D!3!3DJJt4D4I4I!JJK::d#((D$$HTYY$7#8:: LL %  & q)4w6FG  " " LL-ht7N7N.O-PPQR S    LL>(43F3F*G)HJ K||''th'GGrBciddd|jd|jd|jj|jd|jjd|j d|j d |jd |jDcgc]}|jc}d |jDcgc]}|jc}d |jDcgc]}|jc}d |jdn|jjd|jdn|jjd|jdn|jjd|jdn|jjd|jdn|jjdt!|t"j$|j&|j(t+|j(nd|j,|j.|j.jnd|j0|j0jnd|j2d}|Scc}wcc}wcc}w)NrrrGrrrHrRrr[r\rIr]rerMrNr^rar\)rdrTrSrirrA)rGrrrrHrRrr[r\rIr]rerMrNr^rar]rrmrdrTrrSrirrA)r?bcprs r@rzTypeInfo.serializesh" j" 4++"   "  TZZ))$--8 " DII'') " "4#;#; "  "  "4#;#;"  TZZ8akkm8"  11AJJ1"   >1>"  4#3#3#;4AQAQA[A[A]"  !//7T=T=T=^=^=`" ++39L9L9V9V9X#" & $//"9$t?X?X?Z'" ( ++39L9L9V9V9X+" . YtX^^4/" 0 +/::+AVDJJ't$($=$=7;~~7Q113W[00<--779//C" F 591>sI=?J$Jctj|d}tj|d}|d}t|||}|d|_|dDcgc] }|d|dfc}|_|d|_|d |_|d Dcgc]+}tjjj|-c}|_ g}|d D]X} tjj| } t| tjjsJ|j| Z||_|d dn+tjjj|d |_|d dn+tjjj|d |_|ddn+tjjj|d|_|d|_|ddn+tjj*j|d|_|ddn+tjj.j|d|_|d|_|dt5|dnd|_|d|_t;||d|d} | )tjj<j| nd|_|jAdtBj|d|_"|jAd|_#|Scc}wcc}w)NrrHrGrrRrrXrr[r\r]rerMrNrIr^rardrTrSr\rirrA)$rrrrrrRrr[rr_rr\r`rDrarsr]rerMrNrJ TupleTyper^ TypedDictTyperardrrTrSrb TypeVarTyperirrrrA) rrrrHrGtiattrrr]rrsts r@rzTypeInfo.deserializes''W 6##DL1=) eT; /J' AEF[A\!]47DG"4!]K( !%&;!<@DW N1DJJ''33A6Nj! A ++A.Aa!6!67 77 OOA   M"* $$00m1DE ()1 $$006J1KL $%- $$006F1GH E{ L!) %%11$|2DE $%- ))55d;K6LM  :& )-g)B3tG}%"&'=">"d7m$ + ACtzz--99"=UY 88. / ;*@*L*L/0+B '.  s"^Os L0L c t|t|jj||j|j j|t ||jt ||jt||jDcgc]\}}| c}}t||jDcgc]\}}| c}}t||jt||jtjj!||j"t||j$Dcgc]}|jc}tjj!||j&tjj)||j*tjj)||j,tjj)||j.tjj)||j0tjj)||j2t5||t6j8t |t;j<|j>|j@ t|dn+t|dt|tC|j@t||jDtjj)||jF|jH t|dn't|d|jHj|tK||jLycc}}wcc}}wcc}wrg)'r- TYPE_INFOrrrrHr)rGr*rRr&rr$r[rr_r1r\rIr]rirerMrNr^rarjrrmjsondumpsrdrTrrSrirr+rA)r?rrrpsrs r@rzTypeInfo.writeIsK$ " t}}- $(()$ &tD,D,DEDAqaEFtD,D,DEDAqaEFtT^^,4112 ""44t$((;Qajj;< ""47 !!$(8(89 !!$(?(?@ !!$(;(;< !!$8 !!$(;(;<D$/$ 4==12 ::  tU # tT " 4 !3 4tT667 !!$7  ( ( 0 tU # tT "  ) ) / / 5dDOO,5FETZZ%8%88 88 HHOODJJ//44T: ; <%T* 4 5 56 8Q8QRV8WX T?D>TZZ%8%88 88!ZZ0055d;BN T?D>TZZ%8%88 88$(JJ$7$7$<$TZZ%8%88 88 $ 3 3 8 8 >B  T?D>TZZ%:%:: :: JJ0055d;BM T?D>TZZ%?%?? ?? $ 8 8 = =d CB 4X^^,D> t **X.BK T?=./BH"/"5 T?D>TZZ%=%== ==::1166tr)r?rs r@rAzFakeInfo.__init__s rBcv|dk(rtj||Sttj|d)Nrr)object__getattribute__AssertionError)r?rs r@rzFakeInfo.__getattribute__s5 ; **46 6V44T5ABBrBN)rrrIrJ)rrrIr)rNrOrPrRrArrSrBr@rrsI,CrBrzVar is lacking infozFinal[TypeInfo]rzClassDef is lacking infor"z"FuncBase for non-methods lack infor3z*fallback can't be filled out until semanalMISSING_FALLBACKceZdZdZdZdZdddddd dfdZeddZedd Z e dd Z e dd Z e dd Z dd ZddZeddZddZeddZxZS)ra A symbol node representing a type alias. Type alias is a static concept, in contrast to variables with types like Type[...]. Namely: * type aliases - can be used in type context (annotations) - cannot be re-assigned * variables with type Type[...] - cannot be used in type context - but can be re-assigned An alias can be defined only by an assignment to a name (not any other lvalues). Such assignment defines an alias by default. To define a variable, an explicit Type[...] annotation is required. As an exception, at non-global scope non-subscripted rvalue creates a variable even without an annotation. This exception exists to accommodate the common use case of class-valued attributes. See SemanticAnalyzerPass2.check_and_set_up_type_alias for details. Aliases can be generic. We use bound type variables for generic aliases, similar to classes. Essentially, type aliases work as macros that expand textually. The definition and expansion rules are following: 1. An alias targeting a generic class without explicit variables act as the given class (this doesn't apply to TypedDict, Tuple and Callable, which are not proper classes but special type constructors): A = List AA = List[Any] x: A # same as List[Any] x: A[int] # same as List[int] x: AA # same as List[Any] x: AA[int] # Error! C = Callable # Same as Callable[..., Any] T = Tuple # Same as Tuple[Any, ...] 2. An alias using explicit type variables in its rvalue expects replacements (type arguments) for these variables. If missing, they are treated as Any, like for other generics: B = List[Tuple[T, T]] x: B # same as List[Tuple[Any, Any]] x: B[int] # same as List[Tuple[int, int]] def f(x: B[T]) -> T: ... # without T, Any would be used here 3. An alias can be defined using another aliases. In the definition rvalue the Any substitution doesn't happen for top level unsubscripted generic classes: A = List B = A # here A is expanded to List, _not_ List[Any], # to match the Python runtime behaviour x: B[int] # same as List[int] C = List[A] # this expands to List[List[Any]] AA = List[T] D = AA # here AA expands to List[Any] x: D[int] # Error! Note: the fact that we support aliases like `A = List` means that the target type will be initially an instance type with wrong number of type arguments. Such instances are all fixed either during or after main semantic analysis passes. We therefore store the difference between `List` and `List[Any]` rvalues (targets) using the `no_args` flag. Meaning of other fields: target: The target type. For generic aliases contains bound type variables as nested types (currently TypeVar and ParamSpec are supported). _fullname: Qualified name of this type alias. This is used in particular to track fine grained dependencies from aliases. alias_tvars: Type variables used to define this alias. normalized: Used to distinguish between `A = List`, and `A = list`. Both are internally stored using `builtins.list` (because `typing.List` is itself an alias), while the second cannot be subscripted because of Python runtime limitation. line and column: Line and column on the original alias definition. eager: If True, immediately expand alias when referred to (useful for aliases within functions that can't be looked up from the symbol table) ) rFr alias_tvarsno_args normalizedreagertvar_tuple_indexpython_3_12_type_alias)rrFrrNF)rrrrrc*||_||_|g}||_||_||_d|_||_| |_d|_t|D]1\} } t| tjjs+| |_3t |=||yr>)rrFrrrrrrrrLrDrr_rrrrA) r?rFrr9r:rrrrrrPrrs r@rAzTypeAlias.__init__5s"  K& $+/ &<# $k* *DAq!TZZ889()% * v&rBc H|jsJt|jjtjj |tjj |jj|j|j|jS)zGenerate an alias to the tuple type described by a given TypeInfo. NOTE: this doesn't set type alias type variables (for generic tuple types), they must be set by the caller (when fully analyzed). r ) r^r copy_modifiedrr_rtype_vars_as_argsrHrrr9r:rr/s r@rzTypeAlias.from_tuple_typeTs{ OO ) ),,$**66tyy7J7JK *  MM II KK  rBc H|jsJt|jjtjj |tjj |jj|j|j|jS)zGenerate an alias to the TypedDict type described by a given TypeInfo. NOTE: this doesn't set type alias type variables (for generic TypedDicts), they must be set by the caller (when fully analyzed). r) rarrrr_rrrHrrr9r:rs r@rzTypeAlias.from_typeddict_typeis""""    - -,,$**66tyy7J7JK .  MM II KK  rBc>|jjddSNrrHrrs r@rzTypeAlias.name~~~##C(,,rBc|jSr>rrs r@rzTypeAlias.fullnamerrBc:td|jDS)Nc3dK|](}t|tjj*ywr>)rDrr_rq)rurs r@rvz0TypeAlias.has_param_spec_type..s!Uq:a!9!9:U.0)rrrs r@r[zTypeAlias.has_param_spec_typesUDDTDTUUUrBc$|j|Sr>)visit_type_aliasrs r@rzTypeAlias.acceptr&rBc d|j|jj|jDcgc]}|jc}|j|j |j |j|jd }|Scc}w)Nr) rrrFrrrr9r:r) rrFrrrrr9r:r)r?rrs r@rzTypeAlias.serializeso!kk++-373C3CDaAKKMD||//IIkk&*&A&A   EsB c |ddk(sJ|d}|dDcgc]!}tjj|#}}td|DsJtjj|d}|d}|d}|d }|d } |d } ||||| t t tjj |||| Scc}w) Nrrrrc3dK|](}t|tjj*ywr>)rDrr_r.)rurs r@rvz(TypeAlias.deserialize..s!R:a!;!;<RrrFrrr9r:rrrrr)rr_r`rxrrr.) rrrrrrFrrr9r:rs r@rzTypeAlias.deserializesH~,,, #?CM?RS!tzz2215S SRkRRRR,,T(^<y/,' F|h!%&>!?    T$**"<"<={K!#9  Ts&Cct|tt||j|jj |t jj||jt||jt||jt||jt||jt||j yr>)r- TYPE_ALIASr)rrFrrr_r1rr%r9r:r$rrrrs r@rzTypeAlias.writes$ #$' $ ""4)9)9:$ "$ $4&4)4445rBc \t|}tjj|}t t |Dcgc]!}tjj |#}}t||t |t ||t|t|t|Scc}w)Nr) rrr_rrlrr3rr)rrrrFrprs r@rzTypeAlias.readsD>%%d+DI(SW.DYZqtzz44T:Z Z   TN TN#dO #,T?  [s&B))rFrorrr9rEr:rErr4rrrrrrrrrIrJ)r/rrIrrrrr)rrVrIrr)rrrIr)rNrOrPrQrRrrArrrrrrr[rrrrrrrs@r@rrs0Vp IBN@D ',''' '  '=''''!%' '>  (  (--VV.   , 6    rBrcheZdZdZdZdd d dZed dZed dZd dZ dd Z y )PlaceholderNodeaTemporary symbol node that will later become a real SymbolNode. These are only present during semantic analysis when using the new semantic analyzer. These are created if some essential dependencies of a definition are not yet complete. A typical use is for names imported from a module which is still incomplete (within an import cycle): from m import f # Initially may create PlaceholderNode This is particularly important if the imported shadows a name from an enclosing scope or builtins: from m import int # Placeholder avoids mixups with builtins.int Another case where this is useful is when there is another definition or assignment: from m import f def f() -> None: ... In the above example, the presence of PlaceholderNode allows us to handle the second definition as a redefinition. They are also used to create PlaceholderType instances for types that refer to incomplete types. Example: class C(Sequence[C]): ... We create a PlaceholderNode (with becomes_typeinfo=True) for C so that the type C in Sequence[C] can be bound. Attributes: fullname: Full name of the PlaceholderNode. node: AST node that contains the definition that caused this to be created. This is useful for tracking order of incomplete definitions and for debugging. becomes_typeinfo: If True, this refers something that could later become a TypeInfo. It can't be used with type variables, in particular, as this would cause issues with class type variable detection. The long-term purpose of placeholder nodes/types is to evolve into something that can support general recursive types. )rrbecomes_typeinfoF)rc<||_||_||_||_yr>)rrrr9)r?rrr9rs r@rAzPlaceholderNode.__init__s!" 0 rBc>|jjddSrrrs r@rzPlaceholderNode.name rrBc|jSr>rrs r@rzPlaceholderNode.fullname rrBcJd)Nz#PlaceholderNode can't be serializedrSrs r@rzPlaceholderNode.serializes ;;;urBc$|j|Sr>)visit_placeholder_noders r@rzPlaceholderNode.acceptr|rBN) rrrrr9rErrrIrJrrr) rNrOrPrQrRrArrrrrrSrBr@rrsu.`:IQV#'/2IM --<4rBrceZdZdZdZ dddd ddZeddZeddZddZ dd Z dd Z e dd Z dd Ze dd Zy)ra Description of a name binding in a symbol table. These are only used as values in module (global), function (local) and class symbol tables (see SymbolTable). The name that is bound is the key in SymbolTable. Symbol tables don't contain direct references to AST nodes primarily because there can be multiple symbol table references to a single AST node (due to imports and aliases), and different references can behave differently. This class describes the unique properties of each reference. The most fundamental attribute is 'node', which is the AST node that the name refers to. The kind is usually one of LDEF, GDEF or MDEF, depending on the scope of the definition. These three kinds can usually be used interchangeably and the difference between local, global and class scopes is mostly descriptive, with no semantic significance. However, some tools that consume mypy ASTs may care about these so they should be correct. Attributes: node: AST node of definition. Among others, this can be one of FuncDef, Var, TypeInfo, TypeVarExpr or MypyFile -- or None for cross_ref that hasn't been fixed up yet. kind: Kind of node. Possible values: - LDEF: local definition - GDEF: global (module-level) definition - MDEF: class member definition - UNBOUND_IMPORTED: temporary kind for imported names (we don't know the final kind yet) module_public: If False, this name won't be imported via 'from import *'. This has no effect on names within classes. module_hidden: If True, the name will be never exported (needed for stub files) cross_ref: For deserialized MypyFile nodes, the referenced module name; for other nodes, optionally the name of the referenced object. implicit: Was this defined by assignment to self attribute? plugin_generated: Was this symbol generated by a plugin? (And therefore needs to be removed in aststrip.) no_serialize: Do not serialize this node if True. This is used to prevent keys in the cache that refer to modules on which this file does not depend. Currently this can happen if there is a module not in build used e.g. like this: import a.b.c # type: ignore This will add a submodule symbol to parent module `a` symbol table, but `a.b` is _not_ added as its dependency. Therefore, we should not serialize these symbols as they may not be found during fixup phase, instead they will be re-added during subsequent patch parents phase. TODO: Refactor build.py to make dependency tracking more transparent and/or refactor look-up functions to not require parent patching. NOTE: No other attributes should be added to this class unless they are shared by all node kinds. )r~r module_public module_hidden cross_refimplicitplugin_generated no_serializeF)rrct||_||_||_||_||_d|_||_||_yr>)r~rr rr rrr)r?r~rr rr rrs r@rAzSymbolTableNode.__init___s@  *  *%) 0(rBcH|j|jjSyr>)rrrs r@rzSymbolTableNode.fullnamess 99 99%% %rBc|j}t|ttfr|j |jSt|t r|j jSyr>)rrDrrrr:rT)r?rs r@rzSymbolTableNode.typezsIyy dS"78 9dii>S99  i (88== rBct|j|j|j|j|j }|j |_|Sr>)rr~rr rr r)r?news r@rHzSymbolTableNode.copysA IItyy$"4"4dmmTEWEW   rBcBt|jdt|j}t |jt r|d|jj dz }|j|d|jz }|jr|d|jz }|S)N/rr : z cross_ref:) rgr~r1rrDrrrr)r?rs r@rzSymbolTableNode.__str__s$))$%Qz$))'<&= > dii , 2dii(()+ +A 99 3tyyk" "A >> ;t~~./ /ArBcdt|jd}|jrd|d<|jsd|d<|jrd|d<|j rd|d<t |jtr|jj|d <|S|j J|d |||jj}d |vrg||d z|zk7r\t |jtr|jjs,t |jtr Jd |d ||d <|S|jj|d<|S)zSerialize a SymbolTableNode. Args: prefix: full name of the containing module or class; or None name: name of this object relative to the containing object r)rr~Tr Fr rrr:rDefinition of  is unexpectedly incompleter)rgr~r r rrrDrrrrrrr)r?prefixrrrs r@rzSymbolTableNode.serializesO%6z$))?TU   $(D !!!$)D ! ==#D   '+D# $ dii * $ 2 2D   99( '4 '>))$v,7D$T40F d "#'#8F d "#'#8F  ":.FO  %&*+=&>F # rBct||jt||jt||jt||j t||j d}t|jtr|jj}n|j J|d||||jj}d|vrb||dz|zk7rWt|jtr|jjs't|jtr Jd|d|}t|||*|jJ|jj|yy)Nrrrr)r%r~r$r r rrrDrrrrrrr+r)r?rrrrrs r@rzSymbolTableNode.writesB$ "4++,4++,4'4../ dii * **I99( ) rrrr r rrr! read_symbolrr)rrrrs r@rzSymbolTableNode.readsrhtnd3%dO%dO  ( &  "4(CH &CM rBN)TFF)r~rErSymbolNode | Noner rrrr rrrrrrIrJrr)rIrr)rrrrrIrV)rrVrIr)rrrrrrrIrJ)rrrIr)rNrOrPrQrRrArrrrHrrrrrrrSrBr@rrs9v I## )"'")) ) )  )  ))) )(  !F*":  rBcXeZdZdZdZd dZd dZd dZed dZ ddZ eddZ y )rzrStatic representation of a namespace dictionary. This is used for module, class and function namespaces. rScg}|jD]\}}t|trf|jdk7s&|jxsdj ddt vsO|j dt|zdzt|z||j dt|}|jdd |dxxd z cc<d j|S) NbuiltinsrrrHz rz rz SymbolTable(r ) r>rDrrrrnrsrrinsertr)r?rrrs r@rzSymbolTable.__str__s**, -JC%1NNj0-244S9"=EZZHHTCH_u4s5zAB+, - 1I N# " yy|rBc t|jDcgc]\}}||jfc}}Scc}}wr>)rr>rH)r?rrs r@rHzSymbolTable.copys0 M93S$))+.MNNMs= cddi}|jD],\}}|dk(s |jr|j||||<.|S)Nrr __builtins__)r>rr)r?rrrrs r@rzSymbolTable.serializesU"M2**, 7JC n$(:(:#6DI 7 rBc|ddk(sJt}|jD]#\}}|dk7s tj|||<%|S)Nrr)rr>rr)rrrrrs r@rzSymbolTable.deserialize$sVH~... ]**, =JCh)55e<3 = rBc d}|jD]\}}|dk(s |jr|dz }t||t|D]8}||}|dk(s |jrt |||j |||:y)Nrr,rX)r>rr%rr)r)r?rrsizerrs r@rzSymbolTable.write-s**, JC n$(:(: AID  $$< -CIEn$(:(: dC KKh ,  -rBc t|}tt|Dcgc]"}t|tj |f$c}Scc}wr>)rrrlrrr)rrr/rps r@rzSymbolTable.read?s?~RWX\R]^QXd^_-A-A$-GH^__^s'A Nr)rIr)rrrIrV)rrVrIr)rrrrrIrJ)rrrIr) rNrOrPrQrRrrHrrrrrrSrBr@rrsM I$O -$``rBrcteZdZdZdZdddddd d dZd dZed dZd dZ edd Z y)rzSpecifies how a dataclass-like transform should be applied. The fields here are based on the parameters accepted by `typing.dataclass_transform`. eq_default order_defaultkw_only_defaultfrozen_defaultfield_specifiersN)r3r4r5r7r6c~||nd|_||nd|_||nd|_||nd|_|||_yd|_y)NTFrSr2)r?r3r4r5r7r6s r@rAzDataclassTransformSpec.__init__QsW)3(>*D.;.G]U2A2MSX0>0JnPU4D4P 0VXrBc|j|j|j|jt |j dSNr2)r3r4r5r6rr7rs r@rz DataclassTransformSpec.serializecs<//!//#33"11 $T%:%: ;   rBc t|jd|jd|jd|jdt|jdgS)Nr3r4r5r6r7r2)rrtuplers r@rz"DataclassTransformSpec.deserializelsU%xx -((?3 HH%6788$45"488,>#CD   rBct||jt||jt||jt||jt ||j yr>)r$r3r4r5r6r*r7rs r@rzDataclassTransformSpec.writevsP4)4++,4--.4,,-tT223rBc tt|t|t|t|tt|Sr:)rrr<r rs r@rzDataclassTransformSpec.read}s8% #D/%dO$T?"=#67   rB) r3rr4rr5rr7ztuple[str, ...] | Noner6rrIrJr)rrVrIrr)rrrIr) rNrOrPrQrRrArrrrrrSrBr@rrEs<I#'%)'+37'+Y Y# Y % Y 1 Y$Y Y$   4  rBrcF|Dcgc]}t||s|c}Scc}wr>)getattr)rrrs r@r]r]s" :TgdD&9D :: :sc,|D]}t||dyr)setattr)rr\rs r@rbrbs"dD!"rBc>|D]}t|t||yr>)r$r@rrr\rs r@rjrjs".4t,-.rBcD|D]}t|st||dyr)rrBrDs r@roros$& T? D$ %&rBcd}t|jtr|jj}n/t|jtrt |j}|y|d|jS)zReturn the qualified name representation of a member expression. Return a string of form foo.bar, foo.bar.baz, or similar, or None if the argument cannot be represented in this form. Nr)rDrNrrrget_member_expr_fullname)rNinitials r@rGrGs] G$))X&)).. DIIz **4995Ya { ##rBrc`d}d}d}d}t||D]\}}|tk(r|s|s|s|s|d|y|tk(r|s|s|r |d|yd}@|tk(r|s|s|r |d|yd}]|tk(s |t k(rd}|st|d|y|t k(s|r |d|yd}y)NFzHRequired positional args may not appear after default, named or var argsz>Positional default args may not appear after named or var argsTz/Var args may not appear after named or var argsz-A **kwargs argument must be the last argumentz'You may only have one **kwargs argument)rrrrr#r$r%) rnodesfail is_var_arg is_kw_arg seen_namedseen_optr~rs r@check_arg_kindsrPsJIJH)U+ d 7?Y*^ W_Y*UW[\H X Y*FMJ Y $-"7JDdK Y >EI7rBct}t||D]-\}}|||vr|d|d||y|j|/y)NzDuplicate argument "z" in )rrr})rrJrKr seen_namesrrs r@check_arg_namesrSsY #&%J%' d   2 'vU;-@$ G t rBcdt|jtr|jjSy)z.Return whether the expression is ClassVar[...]F)rDrrrrMs r@ is_class_varrUs#$))S!yy$$$ rBc^t|ttttfxr |j S)z6Check whether `node` corresponds to a final attribute.)rDrr9r=r:r*rs r@ is_final_noderWs" dS'+) definitionrDr:rO)rerYs r@ get_func_defrZs$J*i(__ rBc#0K|jD]}\}}|}d|vr|jdd}|dz|z}|j}|s7|j|k(sG|||ft |t s_t |j||Ed{y7w)zIterate over local definitions (not imported) in a symbol table. Recursively iterate over class members and nested classes. z-redefrrN)r>rrrrDrrr)r name_prefixr/rsymnode shortnamerrs r@rrs I g t  8,Q/I$y0|| DMMX-GT) )$),TZZ4HHH IIs$AB BB2B B Bz Final[Tag]rrhrrrrrrrrr r r0ct|}|tk(r)tjjj |S|t k(r)tjjj |S|tk(r)tjjj |S|tk(r)tjjj |S|tk(r)tjjj |S|tk(r)tjjj |S|t k(r)tjj"j |S|t$k(r)tjj&j |S|t(k(r)tjj*j |SJd|)NzUnknown symbol tag )r#rrrJrrrr9rr:rrrhr=rrrrrrrrrtags r@r#r#sV 4.C czzz~~""4(( hzz!!&&t,, izz##((.. izz""''-- !!zz++0066 mzz%%**400 jzz##((.. ozz'',,T22 !!zz**//55-'u--5rBct|}|tk(rtj|S|tk(rt j|SJd|)Nz Invalid tag for an OverloadPart )r#rr:rrr9res r@rmrm6sJ 4.C i~~d## h||D!!:4SE::5rB)rrrIzTypeGuard[list[StrExpr]])rrrr9rIr9)rrr\r9rIrJ)rrrrr\r9rIrJ)rNrrIrE)rr3rJlist[T]rKCallable[[str, T], None]rIrJ)zfunction definition) rzSequence[str | None]rJrhrKrirrrIrJ)rNrrIr)rr$rIr)rezmypy.types.CallableTyperIr$r>)rrr\rr/rrIr)rrrIzmypy.nodes.SymbolNode)rrrIr;)rQ __future__rrrabcr collectionsrcollections.abcrrenumrr typingr r r r rrrrtyping_extensionsrrUrmypy_extensionsr mypy.strconvr mypy.cacherrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r- mypy.optionsr. mypy.utilr/r0r1 mypy.visitorr2r3r4 mypy.patternsr5r7 mypy.typesrTr#rrVrlrWrYr[r]r^r_r`rarbrgr>rhrnrxrzr{r|r}r~rrrrrrr<rrrrrr"r+r-r;r=rzrrrrrrrrrrr9rr:rrrr7rBrrLrXrermrxrrrrrrrrrrrrrrrrrrrrrrrrrrrr#r%r$rr-r5r:r?rFrKrPrZrermrxr~rrrrrrrrrrrrrrrrrrrrrr rrrr$r*r0r5 frozensetrArErrrr"r3rrrrrr]rbrjrorGglobalsrrD issubclassrrrPrSrUrWrZrrrhrrrrrrrrr0r#rm)r_kindrobjs0000r@r~s :" #.VVV@!6!==II%%)%)P CLCH~*%eee % U u U e E64v?OQbc Ec>H>N>N>PQleUUE\QEQ#"% u#" ,-+3'3*  e  (>w&GeG &?'5 $5#" , "!  U:7:"::::::Z  !Q!Q!QJs$5x 7KKL JL_z_D""2*Z*"//*. .&ML? _>$,-G$H/H ()M N oN"#OP%P} } @G4jG4T``FG`$sO+,G`T@ @ F;" . & $$IOO%S Cy 33 # : ""%,"4L" "R-      #    \ CGI I%(I0?II* :"#Z#* :Z z"#Z# : J :.0;iURTQs 1 b8b