
    %^gC                      U d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
 dd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 ddlmZmZ dd	lmZ ddlZ dd
l!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z(m)Z) erddl*m+Z+  G d d      Z,erddl-Z  ed      Z.ee/ef   Z0de1d<   dZ2de1d<   dZ3de1d<   dZ4de1d<   dZ5de1d<   dZ6de1d<   dZ7de1d<   dZ8de1d<   dZ9de1d<   dZ:de1d<   e2d e3d!e4d"e5d#iZ;de1d$<   e;jy                         D  ci c]  \  } }|| 
 c}} Z=de1d%<   d&ddd&d&ddd'Z>de1d(<   d)d*d+d,d-d.d/d0d1d2d3
Z?de1d4<   d5d6iZ@de1d7<   d1d2d8ZAde1d9<   d:d;d<d=d>ZBde1d?<   d@dAdBZCde1dC<   eCj                  dD e?jy                         D               eCd1= eCd2= d7dEZEdFZFde1dG<   dHZGde1dI<    G dJ dKe,      ZHe G dL dMeH             ZIe G dN dOeH             ZJ G dP dQeJ      ZKeJZLde1dR<   e G dS dTeH             ZMee/dUedV   f   ZNde1dW<    G dX dYeM      ZO G dZ d[eI      ZP G d\ d]eP      ZQ G d^ d_eP      ZR G d` daeP      ZSg dbZTde1dc<    G dd deeH      ZUedf   ZVde1dg<    G dh dieUeMeI      ZW G dj dkeH      ZXdZYde1dl<   dZZde1dm<   dZ[de1dn<    G do dp      Z\eTg dqz   Z]de1dr<    G ds dteU      Z^e]g duz   Z_de1dv<   dZ`de1dw<   dZade1dx<   dZbde1dy<    G dz d{e^eMeI      ZceWecfZd G d| d}eMeI      Zeg d~Zfde1d<    G d deM      Zg G d deI      Zh G d deI      Zi G d deI      Zj G d deI      Zk G d deI      Zl G d deI      Zm G d deI      Zn G d deI      Zo G d deI      Zp G d deI      Zq G d deI      Zr G d deI      Zs G d deI      Zt G d deI      Zu G d deI      Zv G d deI      Zw G d deI      Zx G d deI      Zy G d deI      Zz G d deI      Z{ G d deI      Z| G d deJ      Z} G d deJ      Z~d8dZ G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d de      Z G d de      Ze
 G d de	             Zej                  Zde1d<   ej                  Zde1d<   ej                  Zde1d<   ej                  Zde1d<   ej                  Zde1d<   ej                  Zde1d<    G dɄ deJ      Z G d˄ deJ      Z G d̈́ deJ      Z G dτ deJ      Z G dф deJ      Z G dӄ deJ      Z G dՄ deJ      Z G dׄ deJ      Z G dل deJ      Z G dۄ deJ      Z G d݄ deJ      Z G d߄ deJ      Z G d deJ      Z G d de^eJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      ZdZde1d<   dZde1d<   dZde1d<   dZde1d<    G d deMeJ      Z G d d e      Z G d de      Z G d de      Z G d deJ      Z G d deJ      Z G d	 d
eJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z G d deJ      Z eh d      Zde1d<    eh d      Zde1d<    G d dVeM      Z G d de      Z ed      Zde1d<    ed      Zde1d <    ed!      Zde1d"<    ed#      Zde1d$<    G d% d&eM      Z G d' d(eM      Z G d) dU      Z G d* d+ee/ef         Z G d, d-      ZÐd9d.ZĐd:d/ZŐd;d0Z eǫ       jy                         D ci c]3  \  }} e|      eur$ e|eȫ      r e|eM      r|eMur||j                  5 c}}Zde1d1<   	 	 	 	 	 	 	 	 d<d2Z	 d=	 	 	 	 	 	 	 	 	 d>d3Zΐd?d4Zϐd@d5Z	 dA	 	 	 	 	 	 	 dBd6Zyc c}} w c c}}w (C  z4Abstract syntax tree node classes (i.e. parse tree).    )annotationsN)abstractmethod)defaultdict)Enumunique)TYPE_CHECKINGAnyCallableDictFinalIteratorListOptionalSequenceTupleTypeVarUnioncast)	TypeAlias	TypeGuard)trait)Options)is_typeshed_file
short_type)ExpressionVisitorNodeVisitorStatementVisitor)Patternc                  @    e Zd ZdZdZdddZ	 	 	 d	 	 	 	 	 	 	 	 	 d	dZy)
Contextz@Base type for objects that are valid as error message locations.linecolumnend_line
end_columnc                <    || _         || _        d | _        d | _        y Nr!   )selfr"   r#   s      *lib/python3.12/site-packages/mypy/nodes.py__init__zContext.__init__*   s    	$(&*    Nc                    t        |t              r|| _        nD|j                  | _        |j                  | _        |j                  | _        |j
                  | _        ||| _        ||| _        ||| _        yy)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)
isinstanceintr"   r#   r$   r%   )r(   targetr#   r$   r%   s        r)   set_linezContext.set_line0   so     fc"DIDI --DK"OODM$//DO DK$DM!(DO "r+   )r1   )r"   r.   r#   r.   returnNoneNNN
r/   zContext | intr#   
int | Noner$   r6   r%   r6   r2   r3   )__name__
__module____qualname____doc__	__slots__r*   r0    r+   r)   r    r    %   sO    J<I+ "#!%)) ) 	)
 ) 
)r+   r    T
_TypeAliasJsonDictr   LDEF   GDEF   MDEF   UNBOUND_IMPORTEDREVEAL_TYPEREVEAL_LOCALSLITERAL_YESLITERAL_TYPE
LITERAL_NOLdefGdefMdefUnboundImported
node_kindsinverse_node_kindsz__builtins__.str)r7   r:   __path____file____package____annotations____spec__implicit_module_attrsbuiltins.listbuiltins.dictbuiltins.setbuiltins.frozensetzcollections.ChainMapzcollections.Counterzcollections.defaultdictzcollections.dequezcollections.OrderedDictzbuiltins.str)
typing.Listtyping.Dict
typing.Settyping.FrozenSetztyping.ChainMapztyping.Counterztyping.DefaultDictztyping.Dequeztyping.OrderedDicttyping.LiteralStringtype_aliasesr`   )rE      type_aliases_source_versions)ztyping_extensions.OrderedDictztyping_extensions.LiteralStringtyping_extensions_aliasesr\   r]   r^   r_   )rX   rY   rZ   r[   reverse_builtin_aliasesztyping.Tuple )zbuiltins.tuplezbuiltins.enumerate_nongen_builtinsc              #  *   K   | ]  \  }}||f  y wr'   r<   ).0aliasnames      r)   	<genexpr>rl      s     N9M+%u9Ms   c                    | dk  rt         S i S )N)rE   	   )rg   )python_versions    r)   get_nongen_builtinsrp      s    -6>B>r+   )ztyping.runtime_checkableztyping_extensions.runtimez#typing_extensions.runtime_checkableRUNTIME_PROTOCOL_DECOSz<lambda>LAMBDA_NAMEc                  ,    e Zd ZdZdZddZddZd	dZy)
Nodez4Common base class for all non-type parse tree nodes.r<   c                    | j                  t        j                  j                  t	                           }|t        |       S |S Noptions)acceptmypystrconvStrConvr   repr)r(   anss     r)   __str__zNode.__str__   s8    kk$,,..wy.AB;:
r+   c                l    | j                  t        j                  j                  |            }|sJ |S rv   )ry   rz   r{   r|   )r(   rx   r~   s      r)   str_with_optionszNode.str_with_options   s.    kk$,,..w.?@
s
r+   c                ,    t        dt        |             NzNot implementedRuntimeErrortyper(   visitors     r)   ry   zNode.accept       ,d4j99r+   Nr2   str)rx   r   r2   r   r   zNodeVisitor[T]r2   r=   )r7   r8   r9   r:   r;   r   r   ry   r<   r+   r)   rt   rt      s    >I
:r+   rt   c                      e Zd ZdZdZddZy)	StatementzA statement node.r<   c                ,    t        dt        |             r   r   r   s     r)   ry   zStatement.accept   r   r+   Nr   zStatementVisitor[T]r2   r=   r7   r8   r9   r:   r;   ry   r<   r+   r)   r   r      s    I:r+   r   c                      e Zd ZdZdZddZy)
ExpressionzAn expression node.r<   c                ,    t        dt        |             r   r   r   s     r)   ry   zExpression.accept   r   r+   Nr   zExpressionVisitor[T]r2   r=   r   r<   r+   r)   r   r      s    I:r+   r   c                      e Zd ZdZdZy)FakeExpressionzA dummy expression.

    We need a dummy expression in one place, and can't instantiate Expression
    because it is a trait and mypyc barfs.
    r<   N)r7   r8   r9   r:   r;   r<   r+   r)   r   r      s     Ir+   r   Lvaluec                  p    e Zd ZdZdZeedd              Zeedd              Zed	d       Z	e
d
d       Zy)
SymbolNodez+Nodes that can be stored in a symbol table.r<   c                     y r'   r<   r(   s    r)   rk   zSymbolNode.name        	r+   c                     y r'   r<   r   s    r)   fullnamezSymbolNode.fullname   r   r+   c                     y r'   r<   r   s    r)   	serializezSymbolNode.serialize   s    r+   c                f    |d   }t         j                  |      }| ||      S t        d|       )N.classzunexpected .class )deserialize_mapgetNotImplementedError)clsdata	classnamemethods       r)   deserializezSymbolNode.deserialize  s>    N	 $$Y/$<!$6yk"BCCr+   Nr   r2   r?   )r   r?   r2   r   )r7   r8   r9   r:   r;   propertyr   rk   r   r   classmethodr   r<   r+   r)   r   r      sj    5I        D Dr+   r   SymbolTableNodeTypeInfo
Definitionc                  B    e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   	 	 d(	 	 	 	 	 	 	 	 	 d) fdZd*dZe	d+d        Z
e	d+d!       Zd,d"Zd-d#Zd.d$Zd/d%Zd0d&Zed1d'       Z xZS )2MypyFilez1The abstract syntax tree of a single source file.)	_fullnamepathdefs
alias_depsis_bomnamesimportsignored_linesskipped_linesis_stubis_cache_skeletonis_partial_stub_packageplugin_depsfuture_import_flags_is_typeshed_file)rk   r   r   r   r   r   list[Statement]r   zdefaultdict[str, set[str]]r   boolr   SymbolTabler   list[ImportBase]r   zdict[int, list[str]]r   zset[int]r   r   r   r   zdict[str, set[str]]r   zset[str]r   bool | Noner   c                B   t         |           || _        d| _        d| _        || _        || _        t        t              | _	        i | _
        |r|| _        ni | _        t               | _        d| _        d| _        d| _        d| _        t               | _        d | _        y )NrA   r   rf   F)superr*   r   r"   r#   r   r   r   setr   r   r   r   r   r   r   r   r   r   )r(   r   r   r   r   	__class__s        r)   r*   zMypyFile.__init__H  s     			%c*!.D!#D U	!&',$#&5 !%r+   c                B    t        | j                  | j                        S )zyReturn all definitions within the module (including nested).

        This doesn't include imported definitions.
        )local_definitionsr   r   r   s    r)   r   zMypyFile.local_definitionsd  s    
 !T]];;r+   c                Z    | j                   sdS | j                   j                  d      d   S )Nrf   .r1   r   splitr   s    r)   rk   zMypyFile.namek  s'    rJT^^-A-A#-Fr-JJr+   c                    | j                   S r'   r   r   s    r)   r   zMypyFile.fullnameo      ~~r+   c                $    |j                  |       S r'   )visit_mypy_filer   s     r)   ry   zMypyFile.accepts      &&t,,r+   c                    t        | j                        dk7  xr8 t        j                  j                  | j                        j	                  d      S )Nr   z	__init__.)lenr   osbasename
startswithr   s    r)   is_package_init_filezMypyFile.is_package_init_filev  s8    499~"Zrww'7'7		'B'M'Mk'ZZr+   c                    || j                   v S r'   )r   )r(   flags     r)   is_future_flag_setzMypyFile.is_future_flag_sety  s    t////r+   c                |    | j                   %t        |j                  | j                        | _         | j                   S r'   )r   r   abs_custom_typeshed_dirr   r(   rx   s     r)   r   zMypyFile.is_typeshed_file|  s6    !!)%5g6U6UW[W`W`%aD"%%%r+   c           	         d| j                   | j                  j                  | j                         | j                  | j                  | j
                  t        | j                        dS )Nr   )r   r   r   r   r   r   r   )r   r   r   r   r   r   listr   r   s    r)   r   zMypyFile.serialize  sQ     ZZ))$..9||II'+'C'C#'(@(@#A
 	
r+   c                    |d   dk(  sJ |       t        g g       }|d   |_        t        j                  |d         |_        |d   |_        |d   |_        |d   |_        d|_        t        |d	         |_
        |S )
Nr   r   r   r   r   r   r   Tr   )r   r   r   r   r   r   r   r   r   r   r   )r   r   trees      r)   r   zMypyFile.deserialize  s    H~+1T1+Bk* ,,T'];
IL	'+,E'F$!%#&t,A'B#C r+   )FN)
r   r   r   r   r   r   r   zdict[int, list[str]] | Noner2   r3   )r2   Iterator[Definition]r   r   r2   r   )r   r   r2   r   )rx   r   r2   r   r   )r   r?   r2   r   )r7   r8   r9   r:   r;   __match_args__rU   r*   r   r   rk   r   ry   r   r   r   r   r   r   __classcell__r   s   @r)   r   r     s   ;I$ .N N
I
**L (' M "!$$!!"" 59&& "& 	&
 3& 
&8< K K  -[0&	
 
 
r+   r   c                  R     e Zd ZU dZdZded<   ded<   ded<   ded<   d
 fd	Z xZS )
ImportBasez%Base class for all import statements.)is_unreachableis_top_levelis_mypy_onlyassignmentsr   r   r   r   zlist[AssignmentStmt]r   c                Z    t         |           g | _        d| _        d| _        d| _        y NF)r   r*   r   r   r   r   r(   r   s    r)   r*   zImportBase.__init__  s.    #!!r+   r2   r3   )r7   r8   r9   r:   r;   rU   r*   r   r   s   @r)   r   r     s/    /QI &%" "r+   r   c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	Importzimport m [as n])idslist[tuple[str, str | None]]r   c                0    t         |           || _        y r'   )r   r*   r   )r(   r   r   s     r)   r*   zImport.__init__  s    r+   c                $    |j                  |       S r'   )visit_importr   s     r)   ry   zImport.accept  s    ##D))r+   )r   r   r2   r3   r   
r7   r8   r9   r:   r;   r   rU   r*   ry   r   r   s   @r)   r   r     s     IN	%%*r+   r   c                  T     e Zd ZU dZdZdZded<   ded<   ded<   d fd	Zdd
Z xZ	S )
ImportFromzfrom m import x [as y], ...)idr   relativer   r  r.   r  r   r   c                L    t         |           || _        || _        || _        y r'   )r   r*   r  r   r  )r(   r  r  r   r   s       r)   r*   zImportFrom.__init__  s#    
 r+   c                $    |j                  |       S r'   )visit_import_fromr   s     r)   ry   zImportFrom.accept      ((..r+   )r  r   r  r.   r   r   r2   r3   r   r   r   s   @r)   r   r     s*    %+I0NGM''!/r+   r   c                  J     e Zd ZU dZdZdZded<   ded<   d	 fdZd
dZ xZ	S )	ImportAllzfrom m import *)r  r  r   r  r.   r  c                >    t         |           || _        || _        y r'   )r   r*   r  r  )r(   r  r  r   s      r)   r*   zImportAll.__init__  s     r+   c                $    |j                  |       S r'   )visit_import_allr   s     r)   ry   zImportAll.accept      ''--r+   )r  r   r  r.   r2   r3   r   r   r   s   @r)   r  r    s$    "I'NGM!
.r+   r  )is_propertyis_class	is_staticis_finalFUNCBASE_FLAGSc                  V     e Zd ZdZdZd fdZeedd              Zedd       Z	 xZ
S )FuncBasea  Abstract 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.
    )
r   unanalyzed_typeinfor  r  r  r  is_explicit_overrideis_type_check_onlyr   c                    t         |           d | _        d | _        t        | _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        y )NFrf   )r   r*   r   r  FUNC_NO_INFOr  r  r  r  r  r  r  r   r   s    r)   r*   zFuncBase.__init__  sZ     37	=A 	 $)!"'r+   c                     y r'   r<   r   s    r)   rk   zFuncBase.name  r   r+   c                    | j                   S r'   r   r   s    r)   r   zFuncBase.fullname"  r   r+   r   r   )r7   r8   r9   r:   r;   r*   r   r   rk   r   r   r   s   @r)   r  r    sD    I$     r+   r  )FuncDef	DecoratorOverloadPartc                       e Zd ZU dZdZded<   ded<   ded<   ded	<   d fd
Zedd       ZddZ	ddZ
edd       ZddZ xZS )OverloadedFuncDefaR  A logical node representing all the variants of a multi-declaration function.

    A multi-declaration function is often an @overload, but can also be a
    @property with a setter and a/or a deleter.

    This node has no explicit representation in the source program.
    Overloaded variants must be consecutive in the source file.
    )itemsunanalyzed_itemsimpl
deprecatedlist[OverloadPart]r!  r"  zOverloadPart | Noner#  
str | Noner$  c                    t         |           || _        |j                         | _        d | _        d | _        |r-| j                  |d   j                  |d   j                         y y Nr   )
r   r*   r!  copyr"  r#  r$  r0   r"   r#   r(   r!  r   s     r)   r*   zOverloadedFuncDef.__init__;  sW    
 %

	MM%(--q9 r+   c                    | j                   r| j                   d   j                  S | j                  J | j                  j                  S r(  )r!  rk   r#  r   s    r)   rk   zOverloadedFuncDef.nameE  s=    ::::a=%%% 99(((99>>!r+   c                $    |j                  |       S r'   )visit_overloaded_func_defr   s     r)   ry   zOverloadedFuncDef.acceptN      0066r+   c           	     H   d| j                   D cg c]  }|j                          c}| j                  d n| j                  j                         | j                  | j                  d n| j                  j                         t        | t              | j                  dS c c}w )Nr   )r   r!  r   r   r#  flagsr$  )r!  r   r   r   r#  	get_flagsr  r$  )r(   is     r)   r   zOverloadedFuncDef.serializeQ  s|    )-1ZZ8ZakkmZ8 II-D4993F3F3H II-D4993F3F3Ht^4//
 	
8s   Bc                   |d   dk(  sJ t        |d   D cg c]%  }t        t        t        j	                  |            ' c}      }|j                  d      ht        t        t        j	                  |d               |_        t        |j                        dkD  r%|j                  |j                  j                         |j                  d      Ot        j                  j                  |d         }t        |t        j                  j                        sJ ||_        |d   |_        t%        ||d          |d	   |_        |S c c}w )
Nr   r   r!  r#  r   r   r   r0  r$  )r   r   r  r   r   r   r#  r   r!  r0   r"   rz   typesdeserialize_typer-   
ProperTyper   r   	set_flagsr$  )r   r   drestyps        r)   r   zOverloadedFuncDef.deserialize\  s   H~!4444DHMRMqT,
 6 6q 9:MR
 88F'L**@*@f*NOCH399~!SXX]]+88F'**--d6l;Cc4::#8#8999CHZ(#tG}%l+
 Ss   *Ec                :    t        d | j                  D              S )Nc              3  <   K   | ]  }|j                           y wr'   )
is_dynamicri   items     r)   rl   z/OverloadedFuncDef.is_dynamic.<locals>.<genexpr>r  s     <4??$   )allr!  r   s    r)   r=  zOverloadedFuncDef.is_dynamicq  s    <<<<r+   )r!  r%  r2   r3   r   r   r   )r   r?   r2   r   r   )r7   r8   r9   r:   r;   rU   r*   r   rk   ry   r   r   r   r=  r   r   s   @r)   r   r   *  sd     DI((
: " "7	
  (=r+   r   c                  l     e Zd ZdZdZdZ	 d	 	 	 	 	 	 	 	 	 	 	 d fdZ	 	 	 d	 	 	 	 	 	 	 	 	 d fdZ xZS )	Argumentz A single argument in a FuncItem.)variabletype_annotationinitializerkindpos_onlyc                h    t         |           || _        || _        || _        || _        || _        y r'   )r   r*   rD  rE  rF  rG  rH  )r(   rD  rE  rF  rG  rH  r   s         r)   r*   zArgument.__init__|  s5     	 .&	 r+   c                   t         |   ||||       | j                  r_| j                  j                  dk  rF| j                  j                  | j                  | j                  | j
                  | j                         | j                  j                  | j                  | j                  | j
                  | j                         y r(  )r   r0   rF  r"   r#   r$   r%   rD  )r(   r/   r#   r$   r%   r   s        r)   r0   zArgument.set_line  s     	:> 0 0 5 5 9%%diidmmT__]tyy$++t}}dooVr+   F)rD  VarrE  mypy.types.Type | NonerF  Expression | NonerG  ArgKindrH  r   r2   r3   r4   r5   )	r7   r8   r9   r:   r;   r   r*   r0   r   r   s   @r)   rC  rC  u  s    *RIWN !! 0! '	!
 ! ! 
!$ "#!%WW W 	W
 W 
W Wr+   rC  TYPE_VAR_KINDPARAM_SPEC_KINDTYPE_VAR_TUPLE_KINDc                  0    e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 ddZy)	TypeParamrk   rG  upper_boundvaluesdefaultc                J    || _         || _        || _        || _        || _        y r'   rU  )r(   rk   rG  rV  rW  rX  s         r)   r*   zTypeParam.__init__  s(     		&r+   N)rk   r   rG  r.   rV  rM  rW  list[mypy.types.Type]rX  rM  r2   r3   )r7   r8   r9   r;   r*   r<   r+   r)   rT  rT    sF    DI  ,	
 & ( 
r+   rT  )is_overloadis_generatoris_coroutineis_async_generatoris_awaitable_coroutineFUNCITEM_FLAGSc                  X     e Zd ZdZdZdZ	 	 	 	 d	 	 	 	 	 	 	 	 	 d fdZd	dZd
dZ xZ	S )FuncItemz9Base class for nodes usable as overloaded function items.)	arguments	arg_names	arg_kindsmin_argsmax_pos	type_argsbodyr[  r\  r]  r^  r_  expanded)rc  rg  rf  c                   t         |           |xs g | _        | j                  D cg c]&  }|j                  rd n|j                  j
                  ( c}| _        | j                  D cg c]  }|j                   c}| _        | j                  j                  t              | j                  j                  t              z   | _        || _        |xs t        g       | _        || _        || _        d| _        d| _        d| _        d| _        d| _        g | _        d| _        t3        t5        | j                              D ]0  }| j                  |   || j7                         k  s'|dz   | _        2 y c c}w c c}w )NFr   rA   )r   r*   rc  rH  rD  rk   rd  rG  re  countARG_POSARG_OPTrg  rh  Blockri  r   r  r[  r\  r]  r^  r_  rj  rf  ranger   max_fixed_argc)r(   rc  ri  r:  rh  argr2  r   s          r)   r*   zFuncItem.__init__  s>    	"bQUQ_Q_`Q_##,,$CLL4E4EEQ_`=A^^(L^c^(L NN009DNN<P<PQX<YY1:,59		"!&"'"'(-,1#(*s4>>*+A~~a (Q1D1D1F-F !A , a(Ls   +E5*E:c                    | j                   S r'   )rg  r   s    r)   rq  zFuncItem.max_fixed_argc  s    ||r+   c                    | j                   d u S r'   r   r   s    r)   r=  zFuncItem.is_dynamic  s    yyD  r+   )NNNN)
rc  list[Argument] | Noneri  Block | Noner:  mypy.types.FunctionLike | Nonerh  list[TypeParam] | Noner2   r3   )r2   r.   r   )
r7   r8   r9   r:   r;   __deletable__r*   rq  r=  r   r   s   @r)   rb  rb    sa    CI$ 9M ,0!.2,0&(& & ,	&
 *& 
&8!r+   rb  )is_decoratedis_conditionalis_trivial_bodyr   FUNCDEF_FLAGSNOT_ABSTRACTIS_ABSTRACTIMPLICITLY_ABSTRACTc                       e Zd ZdZdZdZ	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 d
 fdZedd       ZddZ	ddZ
edd       Z xZS )r  zQFunction definition.

    This is a non-lambda function defined using 'def'.
    )_namer{  r|  abstract_statusoriginal_def	deco_liner}  r   dataclass_transform_spec	docstringr$  )rk   rc  r   ri  c                    t         |   ||||       || _        d| _        d| _        t
        | _        d| _        d | _        d | _	        d| _
        d | _        d | _        d | _        y r   )r   r*   r  r{  r|  r  r  r}  r  r  r   r  r  r$  )r(   rk   rc  ri  r:  rh  r   s         r)   r*   zFuncDef.__init__  sn     	D#y9
!#+  %>B%)!GK%%)&*r+   c                    | j                   S r'   r  r   s    r)   rk   zFuncDef.name6      zzr+   c                $    |j                  |       S r'   )visit_func_defr   s     r)   ry   zFuncDef.accept:      %%d++r+   c                   d| j                   | j                  | j                  | j                  D cg c]  }t	        |j
                         c}| j                  d n| j                  j                         t        | t              | j                  | j                  d n| j                  j                         | j                  d
S c c}w )Nr  )
r   rk   r   rd  re  r   r0  r  r  r$  )r  r   rd  re  r.   valuer   r   r1  r~  r  r  r$  )r(   xs     r)   r   zFuncDef.serialize=  s      JJ04?1#agg,? II-D4993F3F3Ht]3#33 008 22<<>//
 	

 @s   Cc                   |d   dk(  sJ t        g       }t        |d   g ||d   d nCt        t        j                  j
                  t        j                  j                  |d                     }|d   |_        t        ||d          |d   |_	        |d   D cg c]  }t        |       c}|_        |d	   |_        |d
   t        j                  |d
         nd |_        |d   |_        |`|`|`|S c c}w )Nr   r  rk   r   r   r0  rd  re  r  r  r$  )ro  r  r   rz   r4  FunctionLiker5  r   r7  rd  rO  re  r  DataclassTransformSpecr   r  r$  rc  rg  rf  )r   r   ri  retr  s        r)   r   zFuncDef.deserializeV  s   H~***RyL <' $**114::3N3NtTZ|3\]	
 Z(#tG}%[)-1+->?->->?"#45 ./; #..t4N/OP 	$
 l+MKL
 @s   C4)rf   NNNN)rk   r   rc  rv  ri  rw  r:  rx  rh  ry  r2   r3   r   r   r   )r   r?   r2   r  )r7   r8   r9   r:   r;   r   r*   r   rk   ry   r   r   r   r   r   s   @r)   r  r    s    
I ;N
 +/!.2,0++ )+ 	+
 ,+ *+ 
+4  ,
2  r+   r  c                       e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   ded<   d fdZedd       Z	edd       Z
edd       Zedd       Zedd       ZddZddZedd       ZddZ xZS )r  zhA decorated function.

    A single Decorator object can include any number of function decorators.
    )func
decoratorsoriginal_decoratorsvarr[  )r  r  r  r  r  list[Expression]r  r  rL  r  r   r[  c                    t         |           || _        || _        |j	                         | _        || _        d| _        y r   )r   r*   r  r  r)  r  r  r[  )r(   r  r  r  r   s       r)   r*   zDecorator.__init__  s:    	$#-??#4  r+   c                .    | j                   j                  S r'   )r  rk   r   s    r)   rk   zDecorator.name      yy~~r+   c                .    | j                   j                  S r'   )r  r   r   s    r)   r   zDecorator.fullname      yy!!!r+   c                .    | j                   j                  S r'   )r  r  r   s    r)   r  zDecorator.is_final  r  r+   c                .    | j                   j                  S r'   )r  r  r   s    r)   r  zDecorator.info  r  r+   c                .    | j                   j                  S r'   )r  r   r   s    r)   r   zDecorator.type  s    xx}}r+   c                $    |j                  |       S r'   )visit_decoratorr   s     r)   ry   zDecorator.accept  r   r+   c                    d| j                   j                         | j                  j                         | j                  dS )Nr  )r   r  r  r[  )r  r   r  r[  r   s    r)   r   zDecorator.serialize  s8    !II'')88%%'++	
 	
r+   c                    |d   dk(  sJ t        t        j                  |d         g t        j                  |d               }|d   |_        |S )Nr   r  r  r  r[  )r  r  r   rL  r[  )r   r   decs      r)   r   zDecorator.deserialize  sP    H~,,,++DL92stTY{?[\}-
r+   c                6    | j                   j                         S r'   )r  r=  r   s    r)   r=  zDecorator.is_dynamic      yy##%%r+   )r  r  r  r  r  rL  r2   r3   r   r   )r2   r   r2   rM  r   r   )r   r?   r2   r  )r7   r8   r9   r:   r;   r   rU   r*   r   rk   r   r  r  r   ry   r   r   r   r=  r   r   s   @r)   r  r  |  s    
 TI2N
M  ))	H!   " " " "    -
  &r+   r  )is_selfis_clsis_initialized_in_classis_staticmethodis_classmethodr  is_settable_propertyis_suppressed_importis_classvaris_abstract_varr  is_index_varfinal_unset_in_classfinal_set_in_initexplicit_self_typeis_readyis_inferredinvalid_partial_typefrom_module_getattrhas_explicit_valueallow_incompatible_override	VAR_FLAGSc                  t     e Zd ZdZdZdZd
d fdZedd       Zedd       Z	ddZ
ddZedd	       Z xZS )rL  zPA variable.

    It can refer to global/local variable or a data attribute.
    )r  r   r  r   final_valuer  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )rk   r   r  c                   t         |           || _        d| _        t        | _        || _        d| _        d| _        d| _	        | j                  d u | _
        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        y )Nrf   FT)r   r*   r  r   VAR_NO_INFOr  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r(   rk   r   r   s      r)   r*   zVar.__init__  s    
	,0	99,',$$# $)! $! %*! GK$)!!& #(#(  #(+0( %*!r+   c                    | j                   S r'   r  r   s    r)   rk   zVar.name4  r  r+   c                    | j                   S r'   r   r   s    r)   r   zVar.fullname8  r   r+   c                $    |j                  |       S r'   )	visit_varr   s     r)   ry   z
Var.accept<  s      &&r+   c                    d| j                   | j                  | j                  d n| j                  j                         t	        | t
              d}| j                  | j                  |d<   |S )NrL  )r   rk   r   r   r0  r  )r  r   r   r   r1  r  r  )r(   r   s     r)   r   zVar.serialize?  sd     JJ II-D4993F3F3HtY/
 '"&"2"2Dr+   c                    |d   dk(  sJ |d   }|d   d n!t         j                  j                  |d         }t        ||      }d|_        |d   |_        t        ||d          |j                  d      |_        |S )	Nr   rL  rk   r   Fr   r0  r  )	rz   r4  r5  rL  r  r   r7  r   r  )r   r   rk   r   vs        r)   r   zVar.deserializeM  s    H~&&&F|F|+t1L1LTRX\1ZdO
:&!T']#/r+   r'   )rk   r   r   rM  r2   r3   r   r   r   )r   r?   r2   rL  )r7   r8   r9   r:   r;   r   r*   r   rk   r   ry   r   r   r   r   r   s   @r)   rL  rL    sb    
I: 5N4*l    ' 	 	r+   rL  c                  F    e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   	 	 	 	 	 d#	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$ fdZed%d       Z	e	j                  d&d       Z	d'dZd(d Zd)d!Zed*d"       Z xZS )+ClassDefzClass definition)rk   r   r   rh  	type_varsbase_type_exprsremoved_base_type_exprsr  	metaclassr  keywordsanalyzedhas_incompatible_baseclassr  r  removed_statements)rk   r   r   rk   r   ro  r   ry  rh  z list[mypy.types.TypeVarLikeType]r  r  r  r  r   r  rN  r  r  zdict[str, Expression]r  r  r   r  r   r  c                4   t         |           || _        d| _        || _        |xs g | _        || _        |xs g | _        g | _        t        | _
        || _        g | _        |rt        |      ni | _        d | _        d| _        d | _        d | _        g | _        y Nrf   F)r   r*   rk   r   r   r  rh  r  r  CLASSDEF_NO_INFOr  r  r  dictr  r  r  r  r  r  )	r(   rk   r   r  r  r  r  rh  r   s	           r)   r*   zClassDef.__init__  s     			"b".4"')$$	"*2X*/'%)%)"$r+   c                    | j                   S r'   r   r   s    r)   r   zClassDef.fullname  r   r+   c                    || _         y r'   r   r(   r  s     r)   r   zClassDef.fullname  	    r+   c                $    |j                  |       S r'   )visit_class_defr   s     r)   ry   zClassDef.accept  r   r+   c                6    | j                   j                         S r'   )r  
is_genericr   s    r)   r  zClassDef.is_generic  r  r+   c                    d| j                   | j                  | j                  D cg c]  }|j                          c}dS c c}w )Nr  )r   rk   r   r  )rk   r   r  r   r  s     r)   r   zClassDef.serialize  sA     !II15@A!++-@	
 	
 As   A
c                
   |d   dk(  sJ t        |d   t        g       |d   D cg c]C  }t        t        j                  j
                  t        j                  j                  |            E c}      }|d   |_        |S c c}w )Nr   r  rk   r  r   )r  ro  r   rz   r4  TypeVarLikeTyper5  r   )r   r   r  r9  s       r)   r   zClassDef.deserialize  s    H~+++L"I k**A TZZ//1L1LQ1OP*	
 J'
s   AB )NNNNN)rk   r   r   ro  r  'list[mypy.types.TypeVarLikeType] | Noner  zlist[Expression] | Noner  rN  r  z#list[tuple[str, Expression]] | Nonerh  ry  r2   r3   r   r  r   r2   r3   r   r   r   )r   r?   r2   r  )r7   r8   r9   r:   r;   r   rU   r*   r   r   setterry   r  r   r   r   r   r   s   @r)   r  r  Z  s   I& &N
IN
K%%//%%--
N    ## $$'' >B37'+8<,0%% % ;	%
 1% %% 6% *% 
%:   __ -&
  r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	
GlobalDeclzDeclaration global x, y, ...r   	list[str]r   c                0    t         |           || _        y r'   r   r*   r   r(   r   r   s     r)   r*   zGlobalDecl.__init__      
r+   c                $    |j                  |       S r'   )visit_global_declr   s     r)   ry   zGlobalDecl.accept  r  r+   r   r  r2   r3   r   r   r   s   @r)   r  r    s     &IN/r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	NonlocalDeclzDeclaration nonlocal x, y, ...r  r  r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zNonlocalDecl.__init__  r  r+   c                $    |j                  |       S r'   )visit_nonlocal_declr   s     r)   ry   zNonlocalDecl.accept      **400r+   r  r   r   r   s   @r)   r  r    s     (IN1r+   r  c                  6     e Zd ZdZdZddd fdZddZ xZS )ro  )ri  r   F)r   c               >    t         |           || _        || _        y r'   )r   r*   ri  r   )r(   ri  r   r   s      r)   r*   zBlock.__init__  s    	 -r+   c                $    |j                  |       S r'   )visit_blockr   s     r)   ry   zBlock.accept  s    ""4((r+   )ri  r   r   r   r2   r3   r   )r7   r8   r9   r;   r   r*   ry   r   r   s   @r)   ro  ro    s    *I/NHM -)r+   ro  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	ExpressionStmtz/An expression as a statement, such as print(s).exprr   r   c                0    t         |           || _        y r'   r   r*   r   r(   r   r   s     r)   r*   zExpressionStmt.__init__      	r+   c                $    |j                  |       S r'   )visit_expression_stmtr   s     r)   ry   zExpressionStmt.accept      ,,T22r+   r   r   r2   r3   r   r   r   s   @r)   r  r    s     9IN
3r+   r  c                       e Zd ZU dZdZdZded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   	 	 d	 	 	 	 	 	 	 	 	 d fdZddZ xZ	S )AssignmentStmtab  Assignment 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.
    )lvaluesrvaluer   r  
new_syntaxis_alias_defis_final_definvalid_recursive_alias)r  rvaluesr   list[Lvalue]r  r   r  rM  r   r  r   r  r  r  r  c                    t         |           || _        || _        || _        || _        || _        d| _        d| _        d| _	        y r   )
r   r*   r  r  r   r  r  r  r  r  )r(   r  r  r   r  r   s        r)   r*   zAssignmentStmt.__init__B  sL     		#$!!',$r+   c                $    |j                  |       S r'   )visit_assignment_stmtr   s     r)   ry   zAssignmentStmt.acceptS  r  r+   r   )
r  r  r  r   r   rM  r  r   r2   r3   r   r   r   s   @r)   r
  r
    s    	I 4N
  ++  "! (, -- - %	-
 - 
-"3r+   r
  c                  T     e Zd ZU dZdZdZded<   ded<   ded	<   d fd
ZddZ xZ	S )OperatorAssignmentStmtz,Operator assignment statement such as x += 1)oplvaluer  )r  r  r  r   r  r   r  r   r  c                L    t         |           || _        || _        || _        y r'   )r   r*   r  r  r  )r(   r  r  r  r   s       r)   r*   zOperatorAssignmentStmt.__init__b  s#    r+   c                $    |j                  |       S r'   )visit_operator_assignment_stmtr   s     r)   ry   zOperatorAssignmentStmt.accepth      55d;;r+   )r  r   r  r   r  r   r2   r3   r   r   r   s   @r)   r  r  W  s*    6*I/NGN<r+   r  c                  P     e Zd ZU dZdZded<   ded<   ded<   d
 fdZdd	Z xZS )	WhileStmtr   ri  	else_bodyr   r   ro  ri  rw  r!  c                L    t         |           || _        || _        || _        y r'   r   r*   r   ri  r!  r(   r   ri  r!  r   s       r)   r*   zWhileStmt.__init__u  #    		"r+   c                $    |j                  |       S r'   )visit_while_stmtr   s     r)   ry   zWhileStmt.accept{  r  r+   )r   r   ri  ro  r!  rw  r2   r3   r   	r7   r8   r9   r;   r   rU   r*   ry   r   r   s   @r)   r  r  l  s(    -I2N

K#.r+   r  c                       e Zd ZU dZdZded<   ded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   ded<   	 d	 	 	 	 	 	 	 	 	 	 	 d fdZddZ xZS )ForStmt)	index
index_typeunanalyzed_index_typeinferred_item_typeinferred_iterator_typer   ri  r!  is_async)r+  r,  r   ri  r!  r   r+  rM  r,  r-  r.  r/  r   r   ro  ri  rw  r!  r   r0  c                    t         |           || _        || _        || _        d | _        d | _        || _        || _        || _	        d| _
        y r   )r   r*   r+  r,  r-  r.  r/  r   ri  r!  r0  )r(   r+  r   ri  r!  r,  r   s         r)   r*   zForStmt.__init__  sR     	
$%/""&&*#		"r+   c                $    |j                  |       S r'   )visit_for_stmtr   s     r)   ry   zForStmt.accept  r  r+   r'   )r+  r   r   r   ri  ro  r!  rw  r,  rM  r2   r3   r   r(  r   s   @r)   r*  r*    s    
I JN M&&11..22

KN .2  	
   + 
&,r+   r*  c                  <     e Zd ZU dZdZded<   d fdZddZ xZS )
ReturnStmtr  rN  r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zReturnStmt.__init__  r  r+   c                $    |j                  |       S r'   )visit_return_stmtr   s     r)   ry   zReturnStmt.accept  r  r+   r   rN  r2   r3   r   r(  r   s   @r)   r5  r5    s    IN
/r+   r5  c                  H     e Zd ZU dZdZded<   ded<   dd	 fdZd
dZ xZS )
AssertStmt)r   msgr   r   rN  r<  c                >    t         |           || _        || _        y r'   )r   r*   r   r<  )r(   r   r<  r   s      r)   r*   zAssertStmt.__init__  s    	r+   c                $    |j                  |       S r'   )visit_assert_stmtr   s     r)   ry   zAssertStmt.accept  r  r+   r'   )r   r   r<  rN  r2   r3   r   r(  r   s   @r)   r;  r;    s#    I$N
	
/r+   r;  c                  <     e Zd ZU dZdZded<   d fdZddZ xZS )DelStmtr  r   r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zDelStmt.__init__  r  r+   c                $    |j                  |       S r'   )visit_del_stmtr   s     r)   ry   zDelStmt.accept  r  r+   )r   r   r2   r3   r   r(  r   s   @r)   rA  rA    s    IN
L,r+   rA  c                      e Zd ZdZddZy)	BreakStmtr<   c                $    |j                  |       S r'   )visit_break_stmtr   s     r)   ry   zBreakStmt.accept  r  r+   Nr   r7   r8   r9   r;   ry   r<   r+   r)   rF  rF    s    I.r+   rF  c                      e Zd ZdZddZy)ContinueStmtr<   c                $    |j                  |       S r'   )visit_continue_stmtr   s     r)   ry   zContinueStmt.accept  r  r+   Nr   rI  r<   r+   r)   rK  rK    s    I1r+   rK  c                      e Zd ZdZddZy)PassStmtr<   c                $    |j                  |       S r'   )visit_pass_stmtr   s     r)   ry   zPassStmt.accept  r   r+   Nr   rI  r<   r+   r)   rO  rO    s    I-r+   rO  c                  P     e Zd ZU dZdZded<   ded<   ded<   d
 fdZdd	Z xZS )IfStmtr   r  r   list[Block]ri  rw  r!  c                L    t         |           || _        || _        || _        y r'   r#  r$  s       r)   r*   zIfStmt.__init__  r%  r+   c                $    |j                  |       S r'   )visit_if_stmtr   s     r)   ry   zIfStmt.accept      $$T**r+   )r   r  ri  rT  r!  rw  r2   r3   r   r(  r   s   @r)   rS  rS    s)    -I2N

#+r+   rS  c                  F     e Zd ZU dZdZded<   ded<   d fdZddZ xZS )		RaiseStmt)r   	from_exprrN  r   r[  c                >    t         |           || _        || _        y r'   )r   r*   r   r[  )r(   r   r[  r   s      r)   r*   zRaiseStmt.__init__  s    	"r+   c                $    |j                  |       S r'   )visit_raise_stmtr   s     r)   ry   zRaiseStmt.accept  r  r+   )r   rN  r[  rN  r2   r3   r   r(  r   s   @r)   rZ  rZ    s%    %I*N   #
.r+   rZ  c                       e Zd ZU dZdZded<   ded<   ded<   ded	<   d
ed<   d
ed<   ded<   	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZddZ xZS )TryStmt)ri  r4  varshandlersr!  finally_bodyis_starro  ri  list[Expression | None]r4  list[NameExpr | None]ra  rT  rb  rw  r!  rc  r   rd  c                    t         |           || _        || _        || _        || _        || _        || _        d| _        y r   )	r   r*   ri  ra  r4  rb  r!  rc  rd  )r(   ri  ra  r4  rb  r!  rc  r   s          r)   r*   zTryStmt.__init__-  sB     			
 "(r+   c                $    |j                  |       S r'   )visit_try_stmtr   s     r)   ry   zTryStmt.accept?  r  r+   )ri  ro  ra  rf  r4  re  rb  rT  r!  rw  rc  rw  r2   r3   r   r(  r   s   @r)   r`  r`    s    ]IbN
K""
M $ '	
    # 
$,r+   r`  c                       e Zd ZU dZdZded<   ded<   ded<   d	ed
<   ded<   ded<   	 d	 	 	 	 	 	 	 	 	 d fdZddZ xZS )WithStmt)r   r/   r  analyzed_typesri  r0  )r   r/   ri  r  r   list[Lvalue | None]r/   rM  r  rZ  rl  ro  ri  r   r0  c                v    t         |           || _        || _        || _        g | _        || _        d| _        y r   )r   r*   r   r/   r  rl  ri  r0  )r(   r   r/   ri  target_typer   s        r)   r*   zWithStmt.__init__Q  s<     		* 	r+   c                $    |j                  |       S r'   )visit_with_stmtr   s     r)   ry   zWithStmt.accept`  r   r+   r'   )
r   r  r/   rm  ri  ro  ro  rM  r2   r3   r   r(  r   s   @r)   rk  rk  C  sn    [I/N
++))
KN /3 $ 	
 , 
-r+   rk  c                  n     e Zd ZU dZdZded<   ded<   ded<   ded	<   	 	 	 	 	 	 	 	 	 	 d fd
ZddZ xZS )	MatchStmt)subjectpatternsguardsbodiesr   rt  list[Pattern]ru  re  rv  rT  rw  c                    t         |           t        |      t        |      cxk(  rt        |      k(  sJ  J || _        || _        || _        || _        y r'   )r   r*   r   rt  ru  rv  rw  )r(   rt  ru  rv  rw  r   s        r)   r*   zMatchStmt.__init__n  sQ     	8}F:s6{::::: r+   c                $    |j                  |       S r'   )visit_match_stmtr   s     r)   ry   zMatchStmt.accept|  r  r+   )
rt  r   ru  rx  rv  re  rw  rT  r2   r3   r   r(  r   s   @r)   rs  rs  d  s_    ;I@N##   (	
  
.r+   rs  c                  d     e Zd ZU dZdZded<   ded<   ded<   d	ed
<   ded<   d fdZddZ xZS )TypeAliasStmt)rk   rh  r  r  
alias_node)rk   rh  r  NameExprrk   list[TypeParam]rh  
LambdaExprr  r   r  TypeAlias | Noner~  c                h    t         |           || _        || _        || _        d| _        d | _        y r   )r   r*   rk   rh  r  r  r~  )r(   rk   rh  r  r   s       r)   r*   zTypeAliasStmt.__init__  s2    	"
',$r+   c                $    |j                  |       S r'   )visit_type_alias_stmtr   s     r)   ry   zTypeAliasStmt.accept  r  r+   )rk   r  rh  r  r  r  r2   r3   r   r(  r   s   @r)   r}  r}    s4    WI3N
N!!  3r+   r}  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	IntExprzInteger literalr  r.   r  c                0    t         |           || _        y r'   r   r*   r  r(   r  r   s     r)   r*   zIntExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_int_exprr   s     r)   ry   zIntExpr.accept  r  r+   )r  r.   r2   r3   r   r   r   s   @r)   r  r    s    INJ,r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	StrExprzString literalr  r   r  c                0    t         |           || _        y r'   r  r  s     r)   r*   zStrExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_str_exprr   s     r)   ry   zStrExpr.accept  r  r+   r  r   r2   r3   r   r   r   s   @r)   r  r    s    INJ,r+   r  c                &    t        d | D              S )Nc              3  <   K   | ]  }t        |t                y wr'   )r-   r  r>  s     r)   rl   z"is_StrExpr_list.<locals>.<genexpr>  s     9STz$(Sr@  )rA  )seqs    r)   is_StrExpr_listr    s    9S999r+   c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )		BytesExprzBytes literalr  r   r  c                0    t         |           || _        y r'   r  r  s     r)   r*   zBytesExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_bytes_exprr   s     r)   ry   zBytesExpr.accept  r  r+   r  r   r   r   s   @r)   r  r    s!    IN J.r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )		FloatExprzFloat literalr  floatr  c                0    t         |           || _        y r'   r  r  s     r)   r*   zFloatExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_float_exprr   s     r)   ry   zFloatExpr.accept  r  r+   )r  r  r2   r3   r   r   r   s   @r)   r  r    s    INL.r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	ComplexExprzComplex literalr  complexr  c                0    t         |           || _        y r'   r  r  s     r)   r*   zComplexExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_complex_exprr   s     r)   ry   zComplexExpr.accept      ))$//r+   )r  r  r2   r3   r   r   r   s   @r)   r  r    s    INN0r+   r  c                      e Zd ZdZdZddZy)EllipsisExprzEllipsis (...)r<   c                $    |j                  |       S r'   )visit_ellipsisr   s     r)   ry   zEllipsisExpr.accept  r  r+   Nr   r   r<   r+   r)   r  r    s    I,r+   r  c                  J     e Zd ZU dZdZdZded<   ded<   d	 fdZd
dZ xZ	S )StarExprzStar expression)r   validr   r   r   r  c                >    t         |           || _        d| _        y r   )r   r*   r   r  r  s     r)   r*   zStarExpr.__init__  s    	 
r+   c                $    |j                  |       S r'   )visit_star_exprr   s     r)   ry   zStarExpr.accept  r   r+   r  r   r   r   s   @r)   r  r    s%    !I&N
K-r+   r  c                  `     e Zd ZdZdZd fdZedd       Zej                  dd       Z xZ	S )	RefExprz,Abstract base class for name-like constructs)rG  noder   
is_new_defis_inferred_defis_alias_rvalue
type_guardtype_isc                    t         |           d | _        d | _        d| _        d| _        d| _        d| _        d | _        d | _	        y r  )
r   r*   rG  r  r   r  r  r  r  r  r   s    r)   r*   zRefExpr.__init__.  sJ     $	'+	
  %$26/3r+   c                    | j                   S r'   r   r   s    r)   r   zRefExpr.fullnameD  r   r+   c                    || _         y r'   r   r  s     r)   r   zRefExpr.fullnameH  r  r+   r   r   r  )
r7   r8   r9   r:   r;   r*   r   r   r  r   r   s   @r)   r  r     s>    6	I4,   __ r+   r  c                  <     e Zd ZdZdZdZd fdZddZd	dZ xZ	S )
r  zOName expression

    This refers to a local name, global name or a module.
    )rk   is_special_form)rk   r  c                >    t         |           || _        d| _        y r   )r   r*   rk   r  )r(   rk   r   s     r)   r*   zNameExpr.__init__W  s    	$r+   c                $    |j                  |       S r'   )visit_name_exprr   s     r)   ry   zNameExpr.accept]  r   r+   c                    J d|         )NzSerializing NameExpr: r<   r   s    r)   r   zNameExpr.serialize`  s    5.tf55ur+   )rk   r   r2   r3   r   r   )
r7   r8   r9   r:   r;   r   r*   ry   r   r   r   s   @r)   r  r  M  s#    
 ,I%N%-6r+   r  c                  4     e Zd ZdZdZdZd fdZddZ xZS )
MemberExprzMember access expression x.y)r   rk   def_var)r   rk   r  c                L    t         |           || _        || _        d | _        y r'   )r   r*   r   rk   r  )r(   r   rk   r   s      r)   r*   zMemberExpr.__init__k  s%    		 $(r+   c                $    |j                  |       S r'   )visit_member_exprr   s     r)   ry   zMemberExpr.accepts  r  r+   )r   r   rk   r   r2   r3   r   	r7   r8   r9   r:   r;   r   r*   ry   r   r   s   @r)   r  r  d  s    &+I-N(/r+   r  c                  P    e Zd ZdZdZdZdZdZdZdddZ	dddZ
dd	Zdd
ZddZy)rO  r   rA   rC   rE         c                H    | t         k(  xs | t        k(  xs |xr	 | t        k(  S r'   )rm  rn  ARG_STARr(   stars     r)   is_positionalzArgKind.is_positional  s$    wP$'/Pd6Otx?OPr+   c                H    | t         k(  xs | t        k(  xs |xr	 | t        k(  S r'   )	ARG_NAMEDARG_NAMED_OPT	ARG_STAR2r  s     r)   is_namedzArgKind.is_named  s&    y YDM$9Yd>XtyGXYr+   c                *    | t         k(  xs	 | t        k(  S r'   )rm  r  r   s    r)   is_requiredzArgKind.is_required  s    w3$)"33r+   c                *    | t         k(  xs	 | t        k(  S r'   )rn  r  r   s    r)   is_optionalzArgKind.is_optional  s    w7$-"77r+   c                *    | t         k(  xs	 | t        k(  S r'   )r  r  r   s    r)   rd  zArgKind.is_star  s    x449#44r+   NrK  )r  r   r2   r   r   )r7   r8   r9   rm  rn  r  r  r  r  r  r  r  r  rd  r<   r+   r)   rO  rO  x  s=     GGHIIMQZ485r+   rO  rm  rn  r  r  r  r  c                  N     e Zd ZdZdZdZ	 d	 	 	 	 	 	 	 	 	 	 	 d fdZddZ xZS )	CallExprzCall expression.

    This can also represent several special forms that are syntactically calls
    such as cast(...) and None  # type: ....
    )calleeargsre  rd  r  )r  r  re  rd  c                    t         |           |sd gt        |      z  }|| _        || _        || _        || _        || _        y r'   )r   r*   r   r  r  re  rd  r  )r(   r  r  re  rd  r  r   s         r)   r*   zCallExpr.__init__  sH     	T*I	"+4 !r+   c                $    |j                  |       S r'   )visit_call_exprr   s     r)   ry   zCallExpr.accept  r   r+   r'   )r  r   r  r  re  list[ArgKind]rd  zlist[str | None]r  rN  r2   r3   r   r  r   s   @r)   r  r    s^     IIAN '+!! ! !	!
 $! $! 
!*-r+   r  c                  <     e Zd ZU dZdZded<   d fdZddZ xZS )YieldFromExprr  r   r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zYieldFromExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_yield_from_exprr   s     r)   ry   zYieldFromExpr.accept  r  r+   r  r   r(  r   s   @r)   r  r    s    IN
3r+   r  c                  <     e Zd ZU dZdZded<   d fdZddZ xZS )	YieldExprr  rN  r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zYieldExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_yield_exprr   s     r)   ry   zYieldExpr.accept  r  r+   r9  r   r(  r   s   @r)   r  r    s    IN
.r+   r  c                  ^     e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   d fdZddZ xZ	S )	IndexExprzaIndex expression x[y].

    Also wraps type application such as List[int] as a special form.
    )baser+  method_typer  )r  r+  r   r  r+  rM  r  z&TypeApplication | TypeAliasExpr | Noner  c                Z    t         |           || _        || _        d | _        d | _        y r'   )r   r*   r  r+  r  r  )r(   r  r+  r   s      r)   r*   zIndexExpr.__init__  s+    	
r+   c                $    |j                  |       S r'   )visit_index_exprr   s     r)   ry   zIndexExpr.accept  r  r+   )r  r   r+  r   r2   r3   r   r   r   s   @r)   r  r    s8    
 =I&N
'' 54.r+   r  c                  T     e Zd ZU dZdZdZded<   ded<   ded	<   d fd
ZddZ xZ	S )	UnaryExprzUnary operation)r  r   r  )r  r   r   r  r   r   rM  r  c                L    t         |           || _        || _        d | _        y r'   )r   r*   r  r   r  )r(   r  r   r   s      r)   r*   zUnaryExpr.__init__
  s$    	r+   c                $    |j                  |       S r'   )visit_unary_exprr   s     r)   ry   zUnaryExpr.accept  r  r+   )r  r   r   r   r2   r3   r   r   r   s   @r)   r  r    s+    -I#NG
'' .r+   r  c                  4     e Zd ZdZdZdZd fdZddZ xZS )AssignmentExprz5Assignment expressions in Python 3.8+, like "a := 2".)r/   r  c                >    t         |           || _        || _        y r'   )r   r*   r/   r  )r(   r/   r  r   s      r)   r*   zAssignmentExpr.__init__  s    
r+   c                $    |j                  |       S r'   )visit_assignment_exprr   s     r)   ry   zAssignmentExpr.accept   r  r+   )r/   r   r  r   r2   r3   r   r  r   s   @r)   r  r    s    ?#I(N
3r+   r  c                       e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   	 d	 	 	 	 	 	 	 	 	 d fdZddZ xZ	S )OpExprz^Binary operation.

    The dot (.), [] and comparison operators have more specific nodes.
    )r  leftrightr  right_alwaysright_unreachabler  )r  r  r  r   r  r   r  r  rM  r  r   r  r  TypeAliasExpr | Noner  c                    t         |           || _        || _        || _        d | _        d| _        d| _        || _        y r   )	r   r*   r  r  r  r  r  r  r  )r(   r  r  r  r  r   s        r)   r*   zOpExpr.__init__B  sD     		
!!& r+   c                $    |j                  |       S r'   )visit_op_exprr   s     r)   ry   zOpExpr.acceptN  rX  r+   r'   )
r  r   r  r   r  r   r  r  r2   r3   r   r   r   s   @r)   r  r  $  sx    
I -NG
''"" ^b
!
!'
!0:
!FZ
!	
!+r+   r  c                  \     e Zd ZU dZdZdZded<   ded<   ded	<   d fd
ZddZddZ	 xZ
S )ComparisonExprz+Comparison expression (e.g. a < b > c < d).)	operatorsoperandsmethod_types)r  r  r  r  r  r  zlist[mypy.types.Type | None]r  c                L    t         |           || _        || _        g | _        y r'   )r   r*   r  r  r  )r(   r  r  r   s      r)   r*   zComparisonExpr.__init__^  s$    " r+   c              #     K   t        | j                        D ])  \  }}|| j                  |   | j                  |dz      f + yw)zzIf this comparison expr is "a < b is c == d", yields the sequence
        ("<", a, b), ("is", b, c), ("==", c, d)
        rA   N)	enumerater  r  )r(   r2  operators      r)   pairwisezComparisonExpr.pairwised  sB      %T^^4KAxDMM!,dmmAE.BBB 5s   AAc                $    |j                  |       S r'   )visit_comparison_exprr   s     r)   ry   zComparisonExpr.acceptk  r  r+   )r  r  r  r  r2   r3   )r2   z,Iterator[tuple[str, Expression, Expression]]r   )r7   r8   r9   r:   r;   r   rU   r*   r  ry   r   r   s   @r)   r  r  R  s2    59I.N..C3r+   r  c                  d     e Zd ZU dZdZdZded<   ded<   ded<   	 	 	 	 	 	 	 	 d	 fdZd
dZ xZ	S )	SliceExprznSlice expression (e.g. 'x:y', 'x:', '::2' or ':').

    This is only valid as index in index expressions.
    )begin_index	end_indexstriderN  r  r  r  c                L    t         |           || _        || _        || _        y r'   )r   r*   r  r  r  )r(   r  r  r  r   s       r)   r*   zSliceExpr.__init__}  s&     	&"r+   c                $    |j                  |       S r'   )visit_slice_exprr   s     r)   ry   zSliceExpr.accept  r  r+   )r  rN  r  rN  r  rN  r2   r3   r   r   r   s   @r)   r  r  o  sV    
 7I;N""  	&	 %	 "		
 
	.r+   r  c                  J     e Zd ZU dZdZdZded<   ded<   d	 fdZd
dZ xZ	S )CastExprz!Cast expression cast(type, expr).r   r   r   r   mypy.types.Typer   c                >    t         |           || _        || _        y r'   r   r*   r   r   r(   r   r:  r   s      r)   r*   zCastExpr.__init__      		r+   c                $    |j                  |       S r'   )visit_cast_exprr   s     r)   ry   zCastExpr.accept  r   r+   r   r   r:  r"  r2   r3   r   r   r   s   @r)   r   r     s&    + I%N


-r+   r   c                  J     e Zd ZU dZdZdZded<   ded<   d	 fdZd
dZ xZ	S )AssertTypeExprz1Represents a typing.assert_type(expr, type) call.r!  r   r   r"  r   c                >    t         |           || _        || _        y r'   r$  r%  s      r)   r*   zAssertTypeExpr.__init__  r&  r+   c                $    |j                  |       S r'   )visit_assert_type_exprr   s     r)   ry   zAssertTypeExpr.accept      --d33r+   r)  r   r   r   s   @r)   r+  r+    s&    ; I%N


4r+   r+  c                  n     e Zd ZU dZdZdZded<   ded<   ded<   	 	 	 d	 	 	 	 	 	 	 	 	 d fd	Zdd
Z xZ	S )
RevealExprzGReveal type expression reveal_type(expr) or reveal_locals() expression.)r   rG  local_nodesis_importedrN  r   r.   rG  list[Var] | Noner2  c                Z    t         |           || _        || _        || _        || _        y r'   )r   r*   r   rG  r2  r3  )r(   rG  r   r2  r3  r   s        r)   r*   zRevealExpr.__init__  s.     			&&r+   c                $    |j                  |       S r'   )visit_reveal_exprr   s     r)   ry   zRevealExpr.accept  r  r+   )NNF)
rG  r.   r   rN  r2  r4  r3  r   r2   r3   r   r   r   s   @r)   r1  r1    sf    Q>ICN

I!!
 #'(,!''  ' &	'
 ' 
'/r+   r1  c                  T     e Zd ZU dZdZdZded<   ded<   ded	<   d fd
ZddZ xZ	S )	SuperExprzExpression super().name)rk   r  call)rk   r:  r  r   rk   TypeInfo | Noner  r  r:  c                L    t         |           || _        || _        d | _        y r'   )r   r*   rk   r:  r  )r(   rk   r:  r   s      r)   r*   zSuperExpr.__init__  s#    			r+   c                $    |j                  |       S r'   )visit_super_exprr   s     r)   ry   zSuperExpr.accept  r  r+   )rk   r   r:  r  r2   r3   r   r   r   s   @r)   r9  r9    s*    !(I-N
I

N.r+   r9  c                  >    e Zd ZdZdZedd       Zd	dZd
dZddZ	y)r  zLambda expression)rc  rd  re  ri  c                    t         S r'   )rr   r   s    r)   rk   zLambdaExpr.name  s    r+   c                |    | j                   j                   d   }t        |t              sJ |j                  }|J |S )z/Return the expression (the body) of the lambda.r1   )ri  r-   r5  r   )r(   r  r   s      r)   r   zLambdaExpr.expr  s>    iinnR #z***xxr+   c                $    |j                  |       S r'   )visit_lambda_exprr   s     r)   ry   zLambdaExpr.accept  r  r+   c                     yr   r<   r   s    r)   r=  zLambdaExpr.is_dynamic  s    r+   Nr   )r2   r   r   r   )
r7   r8   r9   r:   r   r   rk   r   ry   r=  r<   r+   r)   r  r    s+    DN /r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	ListExprzList literal expression [...].r!  r  r!  c                0    t         |           || _        y r'   r   r*   r!  r*  s     r)   r*   zListExpr.__init__	  r  r+   c                $    |j                  |       S r'   )visit_list_exprr   s     r)   ry   zListExpr.accept	  r   r+   r!  r  r2   r3   r   r   r   s   @r)   rF  rF    s     (IN-r+   rF  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	DictExprz0Dictionary literal expression {key: value, ...}.rG  *list[tuple[Expression | None, Expression]]r!  c                0    t         |           || _        y r'   rI  r*  s     r)   r*   zDictExpr.__init__	  r  r+   c                $    |j                  |       S r'   )visit_dict_exprr   s     r)   ry   zDictExpr.accept	  r   r+   )r!  rO  r2   r3   r   r   r   s   @r)   rN  rN  	  s     :IN55-r+   rN  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )		TupleExprzXTuple literal expression (..., ...)

    Also lvalue sequences (..., ...) and [..., ...]rG  r  r!  c                0    t         |           || _        y r'   rI  r*  s     r)   r*   zTupleExpr.__init__(	  r  r+   c                $    |j                  |       S r'   )visit_tuple_exprr   s     r)   ry   zTupleExpr.accept,	  r  r+   rL  r   r   r   s   @r)   rT  rT  	  s$    7 IN.r+   rT  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	SetExprz$Set literal expression {value, ...}.rG  r  r!  c                0    t         |           || _        y r'   rI  r*  s     r)   r*   zSetExpr.__init__9	  r  r+   c                $    |j                  |       S r'   )visit_set_exprr   s     r)   ry   zSetExpr.accept=	  r  r+   rL  r   r   r   s   @r)   rY  rY  0	  s     .IN,r+   rY  c                       e Zd ZU dZdZdZded<   ded<   ded	<   d
ed<   ded<   	 	 	 	 	 	 	 	 	 	 	 	 d fdZddZ xZ	S )GeneratorExprzGGenerator expression ... for ... in ... [ for ...  in ... ] [ if ... ].)	left_expr	sequences	condlistsr0  indices)r_  rb  r`  ra  r   r_  r  r`  list[list[Expression]]ra  
list[bool]r0  r  rb  c                h    t         |           || _        || _        || _        || _        || _        y r'   )r   r*   r_  r`  ra  rb  r0  )r(   r_  rb  r`  ra  r0  r   s         r)   r*   zGeneratorExpr.__init__N	  s3     	""" r+   c                $    |j                  |       S r'   )visit_generator_exprr   s     r)   ry   zGeneratorExpr.accept]	      ++D11r+   )r_  r   rb  r  r`  r  ra  rc  r0  rd  r2   r3   r   r   r   s   @r)   r^  r^  A	  sr    QNIGN%%!! ! $	!
 *! ! 
!2r+   r^  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	ListComprehensionz,List comprehension (e.g. [x + 1 for x in a])	generatorr^  rl  c                0    t         |           || _        y r'   r   r*   rl  r(   rl  r   s     r)   r*   zListComprehension.__init__j	      "r+   c                $    |j                  |       S r'   )visit_list_comprehensionr   s     r)   ry   zListComprehension.acceptn	  s    //55r+   rl  r^  r2   r3   r   r   r   s   @r)   rj  rj  a	  s     6I#N#6r+   rj  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	SetComprehensionz+Set comprehension (e.g. {x + 1 for x in a})rk  r^  rl  c                0    t         |           || _        y r'   rn  ro  s     r)   r*   zSetComprehension.__init__{	  rp  r+   c                $    |j                  |       S r'   )visit_set_comprehensionr   s     r)   ry   zSetComprehension.accept	  s    ..t44r+   rs  r   r   r   s   @r)   ru  ru  r	  s     5I#N#5r+   ru  c                       e Zd ZU dZdZdZded<   ded<   ded<   d	ed
<   ded<   ded<   	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZddZ xZ	S )DictionaryComprehensionz3Dictionary comprehension (e.g. {k: v for k, v in a})keyr  r`  ra  r0  rb  )r{  r  rb  r`  ra  r   r{  r  r  r`  rc  ra  rd  r0  r  rb  c                v    t         |           || _        || _        || _        || _        || _        || _        y r'   )r   r*   r{  r  r`  ra  rb  r0  )r(   r{  r  rb  r`  ra  r0  r   s          r)   r*   z DictionaryComprehension.__init__	  s:     	
"" r+   c                $    |j                  |       S r'   )visit_dictionary_comprehensionr   s     r)   ry   zDictionaryComprehension.accept	  r  r+   )r{  r   r  r   rb  r  r`  r  ra  rc  r0  rd  r2   r3   r   r   r   s   @r)   rz  rz  	  s    =QIJN	O%%!! ! 	!
 $! *! ! 
!"<r+   rz  c                  T     e Zd ZU dZdZdZded<   ded<   ded<   d
 fdZdd	Z xZ	S )ConditionalExprz+Conditional expression (e.g. x if y else z))condif_expr	else_expr)r  r  r  r   r  r  r  c                L    t         |           || _        || _        || _        y r'   )r   r*   r  r  r  )r(   r  r  r  r   s       r)   r*   zConditionalExpr.__init__	  s#    	"r+   c                $    |j                  |       S r'   )visit_conditional_exprr   s     r)   ry   zConditionalExpr.accept	  r/  r+   )r  r   r  r   r  r   r2   r3   r   r   r   s   @r)   r  r  	  s,    50I5N
#4r+   r  c                  J     e Zd ZU dZdZdZded<   ded<   d	 fdZd
dZ xZ	S )TypeApplicationz Type application expr[type, ...])r   r4  r   r   rZ  r4  c                >    t         |           || _        || _        y r'   )r   r*   r   r4  )r(   r   r4  r   s      r)   r*   zTypeApplication.__init__	  s    	
r+   c                $    |j                  |       S r'   )visit_type_applicationr   s     r)   ry   zTypeApplication.accept	  r/  r+   )r   r   r4  rZ  r2   r3   r   r   r   s   @r)   r  r  	  s&    *!I&N
  
4r+   r  	INVARIANT	COVARIANTCONTRAVARIANTVARIANCE_NOT_READYc                       e Zd ZU dZdZded<   ded<   ded<   ded<   d	ed
<   eddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZedd       Z	edd       Z
 xZS )TypeVarLikeExprzBase class for TypeVarExpr, ParamSpecExpr and TypeVarTupleExpr.

    Note that they are constructed by the semantic analyzer.
    )r  r   rV  rX  varianceis_new_styler   r  r   r"  rV  rX  r.   r  Fr1   c                z    t         |   |       || _        || _        || _        || _        || _        || _        y N)r"   )r   r*   r  r   rV  rX  r  r  )	r(   rk   r   rV  rX  r  r  r"   r   s	           r)   r*   zTypeVarLikeExpr.__init__	  sA     	d#
!& (r+   c                    | j                   S r'   r  r   s    r)   rk   zTypeVarLikeExpr.name
  r  r+   c                    | j                   S r'   r   r   s    r)   r   zTypeVarLikeExpr.fullname	
  r   r+   )rk   r   r   r   rV  r"  rX  r"  r  r.   r  r   r"   r.   r2   r3   r   )r7   r8   r9   r:   r;   rU   r  r*   r   rk   r   r   r   s   @r)   r  r  	  s    
 ]IJN !  
 M "")) ) %	)
 !) ) ) ) 
)$    r+   r  c                       e Zd ZU dZdZdZded<   eddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZdd	Z	dd
Z
edd       Z xZS )TypeVarExprar  Type 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.
    )rW  )rk   rW  rV  rX  rZ  rW  Fr1   c	           	     @    t         	|   |||||||       || _        y r  )r   r*   rW  )
r(   rk   r   rW  rV  rX  r  r  r"   r   s
            r)   r*   zTypeVarExpr.__init__"
  s)     	xgx\`ar+   c                $    |j                  |       S r'   )visit_type_var_exprr   s     r)   ry   zTypeVarExpr.accept0
  r  r+   c                   d| j                   | j                  | j                  D cg c]  }|j                          c}| j                  j                         | j
                  j                         | j                  dS c c}w )Nr  )r   rk   r   rW  rV  rX  r  )r  r   rW  r   rV  rX  r  )r(   ts     r)   r   zTypeVarExpr.serialize3
  sg    #JJ.2kk:kq{{}k:++557||--/
 	
 ;s   A?
c           
     .   |d   dk(  sJ t        |d   |d   |d   D cg c]!  }t        j                  j                  |      # c}t        j                  j                  |d         t        j                  j                  |d         |d         S c c}w )	Nr   r  rk   r   rW  rV  rX  r  )r  rz   r4  r5  )r   r   r  s      r)   r   zTypeVarExpr.deserialize>
  s    H~...L59(^D^TZZ((+^DJJ''](;<JJ''Y8
 	
 Es   &B)rk   r   r   r   rW  rZ  rV  r"  rX  r"  r  r.   r  r   r"   r.   r2   r3   r   r   )r   r?   r2   r  )r7   r8   r9   r:   r;   r   rU   r  r*   ry   r   r   r   r   r   s   @r)   r  r  
  s    	 IAN "! ""  &	
 % !    
1	
 	
 	
r+   r  c                  6    e Zd ZdZdZddZddZed	d       Zy)
ParamSpecExprr<   rk   rV  rX  c                $    |j                  |       S r'   )visit_paramspec_exprr   s     r)   ry   zParamSpecExpr.acceptP
  rh  r+   c                    d| j                   | j                  | j                  j                         | j                  j                         | j
                  dS )Nr  )r   rk   r   rV  rX  r  )r  r   rV  r   rX  r  r   s    r)   r   zParamSpecExpr.serializeS
  sF    %JJ++557||--/
 	
r+   c           	         |d   dk(  sJ t        |d   |d   t        j                  j                  |d         t        j                  j                  |d         |d         S )Nr   r  rk   r   rV  rX  r  )r  rz   r4  r5  r   r   s     r)   r   zParamSpecExpr.deserialize]
  se    H~000LJJ''](;<JJ''Y8
 	
r+   Nr   r   )r   r?   r2   r  )	r7   r8   r9   r;   r   ry   r   r   r   r<   r+   r)   r  r  K
  s*    I7N2
 
 
r+   r  c                       e Zd ZU dZdZded<   dZeddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZddZ	dd	Z
edd
       Z xZS )TypeVarTupleExprz1Type variable tuple expression TypeVarTuple(...).tuple_fallbackmypy.types.Instancer  Fr1   c	           	     @    t         	|   |||||||       || _        y r  )r   r*   r  )
r(   rk   r   rV  r  rX  r  r  r"   r   s
            r)   r*   zTypeVarTupleExpr.__init__r
  s*     	xgx\`a,r+   c                $    |j                  |       S r'   )visit_type_var_tuple_exprr   s     r)   ry   zTypeVarTupleExpr.accept
  r.  r+   c                    d| j                   | j                  | j                  j                         | j                  j                         | j
                  j                         | j                  dS )Nr  )r   rk   r   rV  r  rX  r  )r  r   rV  r   r  rX  r  r   s    r)   r   zTypeVarTupleExpr.serialize
  sX    (JJ++557"11;;=||--/
 	
r+   c           
        |d   dk(  sJ t        |d   |d   t        j                  j                  |d         t        j                  j                  j                  |d         t        j                  j                  |d         |d         S )	Nr   r  rk   r   rV  r  rX  r  )r  rz   r4  r5  Instancer   r  s     r)   r   zTypeVarTupleExpr.deserialize
  s    H~!3333LJJ''](;<JJ++D1A,BCJJ''Y8
 	
r+   )rk   r   r   r   rV  r"  r  r  rX  r"  r  r.   r  r   r"   r.   r2   r3   r   r   )r   r?   r2   r  )r7   r8   r9   r:   r;   rU   r   r  r*   ry   r   r   r   r   r   s   @r)   r  r  i
  s    ; I''7N ""-- - %	-
 ,- !- - - - 
-7	
 	
 	
r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	TypeAliasExprzType alias expression (rvalue).r  r   r  c                0    t         |           || _        y r'   )r   r*   r  )r(   r  r   s     r)   r*   zTypeAliasExpr.__init__
  r  r+   c                $    |j                  |       S r'   )visit_type_alias_exprr   s     r)   ry   zTypeAliasExpr.accept
  r  r+   )r  r   r2   r3   r   r   r   s   @r)   r  r  
  s    )IN
O3r+   r  c                  L     e Zd ZU dZdZdZded<   ded<   d
d fdZdd	Z xZ	S )NamedTupleExprz:Named tuple expression namedtuple(...) or NamedTuple(...).)r  is_typedr  r   r  r   r  c                >    t         |           || _        || _        y r'   )r   r*   r  r  )r(   r  r  r   s      r)   r*   zNamedTupleExpr.__init__
  s    	 r+   c                $    |j                  |       S r'   )visit_namedtuple_exprr   s     r)   ry   zNamedTupleExpr.accept
  r  r+   rK  )r  r   r  r   r2   r3   r   r   r   s   @r)   r  r  
  s&    D$IN NN!
3r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )	TypedDictExprz%Typed dict expression TypedDict(...).r  r   r  c                0    t         |           || _        y r'   )r   r*   r  )r(   r  r   s     r)   r*   zTypedDictExpr.__init__
  r  r+   c                $    |j                  |       S r'   )visit_typeddict_exprr   s     r)   ry   zTypedDictExpr.accept
  rh  r+   )r  r   r2   r3   r   r   r   s   @r)   r  r  
  s!    /IN N2r+   r  c                  T     e Zd ZU dZdZdZded<   ded<   ded<   d fd	Zdd
Z xZ	S )EnumCallExprz5Named tuple expression Enum('name', 'val1 val2 ...').)r  r!  rW  r   r  r  r!  re  rW  c                L    t         |           || _        || _        || _        y r'   )r   r*   r  r!  rW  )r(   r  r!  rW  r   s       r)   r*   zEnumCallExpr.__init__
  s#    	
r+   c                $    |j                  |       S r'   )visit_enum_call_exprr   s     r)   ry   zEnumCallExpr.accept
  rh  r+   )r  r   r!  r  rW  re  r2   r3   r   r   r   s   @r)   r  r  
  s-    ?+I0N N##2r+   r  c                  <     e Zd ZU dZdZded<   d fdZddZ xZS )	PromoteExprz2Ducktype class decorator expression _promote(...).ru  mypy.types.ProperTyper   c                0    t         |           || _        y r'   )r   r*   r   )r(   r   r   s     r)   r*   zPromoteExpr.__init__
  r  r+   c                $    |j                  |       S r'   )visit__promote_exprr   s     r)   ry   zPromoteExpr.accept
  r  r+   )r   r  r2   r3   r   )	r7   r8   r9   r:   r;   rU   r*   ry   r   r   s   @r)   r  r  
  s    <I
1r+   r  c                  h     e Zd ZU dZdZdZded<   ded<   ded<   	 	 	 	 	 	 	 	 	 	 d fd	Zdd
Z xZ	S )NewTypeExprz NewType expression NewType(...).)rk   old_typer  r   rk   rM  r  r;  r  c                R    t         |   ||       || _        || _        d | _        y )N)r"   r#   )r   r*   rk   r  r  )r(   rk   r  r"   r#   r   s        r)   r*   zNewTypeExpr.__init__  s,     	d62	 	r+   c                $    |j                  |       S r'   )visit_newtype_exprr   s     r)   ry   zNewTypeExpr.accept  r  r+   )
rk   r   r  rM  r"   r.   r#   r.   r2   r3   r   r   r   s   @r)   r  r  
  sS    *,I1N
I$$
#9ADNQ	0r+   r  c                  @     e Zd ZU dZdZdZded<   d fdZddZ xZ	S )		AwaitExprzAwait expression (await ...).r  r   r   c                0    t         |           || _        y r'   r  r  s     r)   r*   zAwaitExpr.__init__  r  r+   c                $    |j                  |       S r'   )visit_await_exprr   s     r)   ry   zAwaitExpr.accept  r  r+   r  r   r   r   s   @r)   r  r    s     'IN
.r+   r  c                  f     e Zd ZU dZdZded<   ded<   	 ddd	 	 	 	 	 	 	 d fd	Zdd
ZddZ xZ	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.
    )r   no_rhsr"  r   r   r  N)contextc                   t         |           || _        || _        |#|j                  | _        |j
                  | _        yy)zJConstruct a dummy node; optionally borrow line/column from context object.N)r   r*   r   r  r"   r#   )r(   r:  r  r  r   s       r)   r*   zTempNode.__init__5  s?     		DI!..DK r+   c                J    d| j                   t        | j                        fz  S )NzTempNode:%d(%s))r"   r   r   r   s    r)   __repr__zTempNode.__repr__@  s     DIIs499~#>>>r+   c                $    |j                  |       S r'   )visit_temp_noder   s     r)   ry   zTempNode.acceptC  r   r+   rK  )r:  r"  r  r   r  zContext | Noner2   r3   r   r   )
r7   r8   r9   r:   r;   rU   r*   r  ry   r   r   s   @r)   r  r  &  sX     #I
 L 49	)W[	)"	),0	)FT	)		)?-r+   r  >   r:   __new____dict__r*   r;   r8   __weakref__rU   __subclasshook____class_getitem____abstractmethods__EXCLUDED_PROTOCOL_ATTRIBUTES>   _order__ignore_	__order__EXCLUDED_ENUM_ATTRIBUTESc                      e Zd ZU dZdZded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   d ed!<   ded"<   ded#<   ded$<   ded%<   ded&<   d ed'<   d(ed)<   ded*<   d+ed,<   ded-<   d.ed/<   ded0<   ded1<   d2ed3<   d4ed5<   d6ed7<   d8ed9<   ded:<   d;ed<<   g d=Zd>ed?<   dX fd@ZdYdAZe	dZdB       Z
e	dZdC       Zd[dDZd\dEZd]dFZe	d^dG       Ze	d^dH       Zd_dIZdZdJZd[dKZd`dLZdadMZdbdNZd[dOZdcdPZdddQZdedRZdfdSZdZdTZ	 	 	 	 	 	 dgdUZdhdVZedidW       Z  xZ!S )jr   a  The 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_namedefnmro	_mro_refsbad_mror  declared_metaclassmetaclass_typer   is_abstractis_protocolruntime_protocolabstract_attributesdeletable_attributesslotsassumingassuming_proper	inferringis_enumfallback_to_anymeta_fallback_to_anyr  has_param_spec_typebases_promote
tuple_typespecial_aliasis_named_tupletypeddict_type
is_newtypeis_intersectionmetadataalt_promotehas_type_var_tuple_typetype_var_tuple_prefixtype_var_tuple_suffix	self_typer  r  r$  r   r   r  r  r  list[TypeInfo]r  zlist[str] | Noner  r   r  r  mypy.types.Instance | Noner  r  r   r   r  r  r  zlist[tuple[str, int]]r  r  r  zset[str] | Noner  z5list[tuple[mypy.types.Instance, mypy.types.Instance]]r  r  zlist[mypy.types.Instance]r  r  r   r  r  r  r  zlist[mypy.types.ProperType]r  r  zmypy.types.TupleType | Noner  r  zmypy.types.TypedDictType | Noner  r	  r
  zdict[str, JsonDict]r  r  r  zmypy.types.TypeVarType | Noner  zDataclassTransformSpec | Noner  r  r&  r$  )
r  r  r   r  r  r	  r  r  r  r
  r   FLAGSc                   t         |           |j                  | _        || _        || _        || _        g | _        d| _        d| _	        g | _
        g | _        d| _        d| _        d| _        d| _        d| _        g | _        g | _        d| _        g | _        g | _        g | _        d| _        d| _        d| _        d| _        | j7                          d| _        d| _        d| _        d| _        g | _         d| _!        d| _"        d| _#        d| _$        d| _%        d| _&        d| _'        i | _(        d| _)        d| _*        d| _+        d| _,        y)zInitialize a TypeInfo.FN)-r   r*   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  add_type_varsr  r  r   r  r  r  r  r  r  r  r	  r
  r  r  r  r  r$  )r(   r   r  r  r   s       r)   r*   zTypeInfo.__init__>  sS   
	&#( ',$
"&" #% $&!
!  %15"15"$$)!!#"$(,%"'r+   c                   d| _         | j                  j                  rt        | j                  j                        D ]  \  }}t	        |t
        j                  j                        rd| _        t	        |t
        j                  j                        rF| j                   rJ d| _         || _
        t        | j                  j                        |z
  dz
  | _        | j                  j                  |j                          y y )NFTrA   )r  r  r  r  r-   rz   r4  ParamSpecTyper  TypeVarTupleTyper  r   r  appendrk   )r(   r2  vds      r)   r  zTypeInfo.add_type_varsl  s    ',$99"499#6#672b$**":":;/3D,b$**"="=>#;;;;37D012D.14TYY5H5H1IA1MPQ1QD.%%bgg. 8 r+   c                .    | j                   j                  S )zShort name.)r  rk   r   s    r)   rk   zTypeInfo.namey  s     yy~~r+   c                    | j                   S r'   r   r   s    r)   r   zTypeInfo.fullname~  r   r+   c                2    t        | j                        dkD  S )z7Is the type generic (i.e. does it have type variables)?r   )r   r  r   s    r)   r  zTypeInfo.is_generic  s    4>>"Q&&r+   c                h    | j                   D ]#  }|j                  j                  |      }|s!|c S  y r'   )r  r   r   )r(   rk   r   ns       r)   r   zTypeInfo.get  s/    88C		d#A  r+   c                J    | j                   D ]  }||j                  v s|c S  y r'   )r  r   )r(   rk   r   s      r)   get_containing_type_infoz!TypeInfo.get_containing_type_info  s&    88Csyy 
  r+   c                X   t               }| j                  sJ d       | j                  d d D ]q  }|j                  s|j                  j	                         D ]E  \  }}t        |j                  t        t        t        f      r,|t        v r5|j                  |       G s t        |      S )Nz?This property can be only accessed after MRO is (re-)calculatedr1   )r   r  r  r   r!  r-   r  r   r  r   r  addsorted)r(   membersr  rk   r  s        r)   protocol_memberszTypeInfo.protocol_members  s      ExxZZZxHHSbMD"&**"2"2"4JD$!$))ih-OP ;; KK% #5 " gr+   c                    | j                   j                         D cg c]P  \  }}t        |j                  t              r1|t
        vr)|j                  d      s|j                  j                  r|R c}}S c c}}w )N__)r   r!  r-   r  rL  r  r   r  )r(   rk   syms      r)   enum_memberszTypeInfo.enum_members  sj     "ZZ--/	
/	c388S) 88-HH// /	
 		
 	
s   AA7c                B    | j                  |      }|r|S t        |      r'   )r   KeyError)r(   rk   r  s      r)   __getitem__zTypeInfo.__getitem__  s!    HHTNH4. r+   c                "    d| j                    dS )Nz
<TypeInfo >)r   r   s    r)   r  zTypeInfo.__repr__  s    DMM?!,,r+   c                $    t        | t               S r'   )r-   FakeInfor   s    r)   __bool__zTypeInfo.__bool__  s     dH---r+   c                (    | j                  |      d uS r'   )r   )r(   rk   s     r)   has_readable_memberzTypeInfo.has_readable_member  s    xx~T))r+   c                    | j                   D ]S  }||j                  v s|j                  |   j                  }t        |t              r|c S t        |t
              r|c S  y  y r'   )r  r   r  r-   r  r  )r(   rk   r   r  s       r)   
get_methodzTypeInfo.get_method  sU    88Csyy yy++dH-Ki0K  r+   c                   | j                   }||j                  j                  d      s|S | j                  dk(  r t        j
                  j                  | g       S | j                  D cg c]0  }|j                   "|j                   j                  |j                   2 }}|D ]  t        fd|D              sc S  y c c}w )Nbuiltins.typec              3  b   K   | ]&  }|j                   j                   j                  v  ( y wr'   )r   r  )ri   othercs     r)   rl   z4TypeInfo.calculate_metaclass_type.<locals>.<genexpr>  s#     D5::+s   ,/)	r  r   has_baser   rz   r4  r  r  rA  )r(   declareds
candidatesr;  s       @r)   calculate_metaclass_typez!TypeInfo.calculate_metaclass_type  s    **(>(>(OO>>_,::&&tR00 XX
##/A4H4H4M4M4Y    	 

 ADDD  
s   *5Cc                b    | j                  d      xs | j                  dk(  xs | j                  S )Nr8  zabc.ABCMeta)r<  r   r   r   s    r)   is_metaclasszTypeInfo.is_metaclass  s2    MM/* $}}-$##	
r+   c                H    | j                   D ]  }|j                  |k(  s y y)zReturn True if type has a base type with the specified name.

        This can be either via extension or via implementation.
        TF)r  r   )r(   r   r   s      r)   r<  zTypeInfo.has_base  s&    
 88C||x'  r+   c                T    | j                   D cg c]  }|j                   c}S c c}w )zXReturn a direct base classes.

        Omit base classes of other base classes.
        )r  r   )r(   r  s     r)   direct_base_classeszTypeInfo.direct_base_classes  s$    
 '+jj1jd		j111s   %c                    || _         t        j                  |       }| j                  s|| _        y|j                  | j                  _        y)z.Update tuple_type and special_alias as needed.N)r  r   from_tuple_typer  r/   r(   r:  rj   s      r)   update_tuple_typezTypeInfo.update_tuple_type  s<    ))$/!!!&D(-D%r+   c                    || _         t        j                  |       }| j                  s|| _        y|j                  | j                  _        y)z2Update typeddict_type and special_alias as needed.N)r  r   from_typeddict_typer  r/   rH  s      r)   update_typeddict_typezTypeInfo.update_typeddict_type  s=    !--d3!!!&D(-D%r+   c                    t               }| j                  t        j                  j	                  |      t        j
                  j                  |            S )zzReturn a string representation of the type.

        This includes the most important information about the type.
        rw   )str_convtype_str_conv)r   dumprz   r{   r|   r4  TypeStrVisitorr   s     r)   r   zTypeInfo.__str__
  sK    
 )yy\\))'):**33G3D  
 	
r+   c                   d}dfddj                  |       z   }| j                  r(ddj                  fd| j                  D               d}dj                  dj                  fd	| j                  D                    }g }t        | j                        D ]  }|j                  | j                  |   j                        z   }| j                  |   j                  }	t        |	t              r%|	j                  r|d
 |	j                         dz  }|j                  |        d| j                   d||d|fg}
| j                  r%|
j                  d | j                         d       | j                  r%|
j                  d | j                         d       t        j                   j#                  |
|      S )z5Return a string dump of the contents of the TypeInfo.rf   c                &    | j                        S r'   )ry   )r:  rO  s    r)   type_strzTypeInfo.dump.<locals>.type_str  s    ::m,,r+   r   zBases(z, c              3  .   K   | ]  } |        y wr'   r<   )ri   r  rT  s     r)   rl   z TypeInfo.dump.<locals>.<genexpr>!  s     %Lhtns   )zMro({})c              3  Z   K   | ]"  }|j                   j                  |      z    $ y wr'   )r   	format_id)ri   r?  rN  s     r)   rl   z TypeInfo.dump.<locals>.<genexpr>#  s&     T84dmmh&8&8&>>8s   (+ (zName(NameszDeclaredMetaclass(zMetaclassType()rN  )r:  r"  r2   r   )rX  r  joinformatr  r$  r   r  r-   rL  r   r  r   r  r  rz   r{   dump_tagged)r(   rN  rO  r  headr  r   rk   descriptionr  r!  rT  s    ``        @r)   rP  zTypeInfo.dump  s   
 	- H..t44::DII%L%LLMQODIIT488TT
 4::&D!3!3DJJt4D4I4I!JJK::d#((D$$HTYY$7#8::LL% ' q)4w6FG""LL-ht7N7N.O-PPQRSLL>(43F3F*G)HJK||''th'GGr+   c                   i ddd| j                   d| j                  d| j                  j                  | j                        d| j                  j                         d| j
                  d| j                  d	| j                  d
| j                  D cg c]  }|j                          c}d| j                  D cg c]  }|j                   c}d| j                  D cg c]  }|j                          c}d| j                  d n| j                  j                         d| j                  d n| j                  j                         d| j                  d n| j                  j                         d| j                  d n| j                  j                         d| j                  d n| j                  j                         dt!        | t"        j$                        | j&                  | j(                  t+        | j(                        nd | j,                  | j.                  | j.                  j                         nd | j0                  | j0                  j                         nd | j2                  d}|S c c}w c c}w c c}w )Nr   r   r  r   r   r  r  r  r  r  r  r  r  r  r  r  r  r0  )r  r  r  r  r  r$  )r  r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r1  r   r  r  r  r$  r  r  r  r$  )r(   br;  pr   s        r)   r   zTypeInfo.serialize3  st   "
j"
4++"
 "
 TZZ))$--8	"

 DII'')"
 "4#;#;"
 "
 "4#;#;"
 TZZ8ZakkmZ8"
 11AJJ1"
 >1>"
 4#3#3#;4AQAQA[A[A]"
 !//7T=T=T=^=^=`"
  ++39L9L9V9V9X#"
& $//"9$t?X?X?Z'"
( ++39L9L9V9V9X+"
. YtX^^4/"
0 +/::+AVDJJ't$($=$=7;~~7Q113W[ 00< --779//C"
F 5 91>s   I=?J$Jc                   t         j                  |d         }t        j                  |d         }|d   }t        |||      }|d   |_        |d   D cg c]  }|d   |d   f c}|_        |d   |_        |d	   |_        |d
   D cg c]+  }t        j                  j                  j                  |      - c}|_        g }|d   D ]X  }	t        j                  j                  |	      }
t        |
t        j                  j                        sJ |j                  |
       Z ||_        |d   d n+t        j                  j                  j                  |d         |_        |d   d n+t        j                  j                  j                  |d         |_        |d   d n+t        j                  j                  j                  |d         |_        |d   |_        |d   d n+t        j                  j*                  j                  |d         |_        |d   d n+t        j                  j.                  j                  |d         |_        |d   |_        |d   t5        |d         nd |_        |d   |_        t;        ||d          |d   }|)t        j                  j<                  j                  |      nd |_        |jA                  d      tB        j                  |d         |_"        |jA                  d      |_#        |S c c}w c c}w )Nr   r  r  r   r  r   rA   r  r  r  r  r  r  r  r  r  r  r  r  r  r0  r  r  r$  )$r   r   r  r   r   r  r  r  rz   r4  r  r  r5  r-   r6  r  r  r  r  r  r  	TupleTyper  TypedDictTyper  r  r   r  r  r7  TypeVarTyper  r   r  r  r$  )r   r   r   r  r  tiattrra  r  rb  r  sts               r)   r   zTypeInfo.deserializeZ  s    ''W6##DL1=)eT;/J'AEF[A\!]A\47DG"4A\!]K(!%&;!<@DWN1DJJ''33A6Nj!A

++A.Aa!6!6777OOA "  M"* $$00m1DE 	 ()1 $$006J1KL 	 $%- $$006F1GH 	 E{ L!) %%11$|2DE 	 $%- ))55d;K6LM 	
 :&)-g)B3tG}%"&'=">"d7m$+ACtzz--99"=UY88./;*@*L*L/0+B' .	s "^ Os   L0L
)r   r   r  r  r  r   r2   r3   r   r   r   )rk   r   r2   zSymbolTableNode | None)rk   r   r2   r;  )r2   r  )rk   r   r2   r   )rk   r   r2   r   )rk   r   r2   zFuncBase | Decorator | None)r2   r  )r   r   r2   r   )r2   r  )r:  zmypy.types.TupleTyper2   r3   )r:  zmypy.types.TypedDictTyper2   r3   )rN  zmypy.strconv.StrConvrO  zmypy.types.TypeStrVisitorr2   r   r   )r   r?   r2   r   )"r7   r8   r9   r:   r;   rU   r  r*   r  r   rk   r   r  r   r!  r&  r*  r-  r  r2  r4  r6  r@  rB  r<  rE  rI  rL  r   rP  r   r   r   r   r   s   @r)   r   r   ^  s   
*IX N 
N 
  MN22.. /.## , DCJJ )( M  
   %$ *) ,+ ,+  43   "! $# -, <;  E5 ,\/    '    

 

!-.*
 
255	
H,H=VH	H<%N @ @r+   c                       e Zd ZdZddZddZy)r1  r<  c                    || _         y r'   rk  )r(   r<  s     r)   r*   zFakeInfo.__init__  s	    r+   c                v    |dk(  rt         j                  | |      S t        t         j                  | d            )Nr   r<  )object__getattribute__AssertionError)r(   rh  s     r)   ro  zFakeInfo.__getattribute__  s5    ;**466V44T5ABBr+   N)r<  r   r2   r3   )rh  r   r2   r   )r7   r8   r9   r;   r*   ro  r<   r+   r)   r1  r1    s    I,Cr+   r1  zVar is lacking infozFinal[TypeInfo]r  zClassDef is lacking infor  z"FuncBase for non-methods lack infor  z*fallback can't be filled out until semanalMISSING_FALLBACKc                       e Zd ZdZdZdZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZedd       Zedd	       Z	e
dd
       Ze
dd       Ze
dd       ZddZddZedd       Z xZS )r   a  
    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. See also TypeAliasExpr.no_args.

    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)
    )	r/   r   alias_tvarsno_args
normalized_is_recursiveeagertvar_tuple_indexpython_3_12_type_alias)rk   r/   rs  rt  NF)rs  rt  ru  rw  ry  c               *   || _         || _        |g }|| _        || _        || _        d | _        || _        |	| _        d | _        t        |      D ]1  \  }
}t        |t        j                  j                        s+|
| _        3 t        | =  ||       y r'   )r   r/   rs  rt  ru  rv  rw  ry  rx  r  r-   rz   r4  r  r   r*   )r(   r/   r   r"   r#   rs  rt  ru  rw  ry  r2  r  r   s               r)   r*   zTypeAlias.__init__,  s     "K&$ +/
&<# $k*DAq!TZZ889()% + 	v&r+   c           
     H   |j                   sJ t        |j                   j                  t        j                  j                  |t        j                  j                  |j                  j                                    |j                  |j                  |j                        S )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).
        fallback)r  r   copy_modifiedrz   r4  r  type_vars_as_argsr  r  r   r"   r#   r   r  s     r)   rG  zTypeAlias.from_tuple_typeK  s{     OO)),,$**66tyy7J7JK *  MMIIKK

 
	
r+   c           
     H   |j                   sJ t        |j                   j                  t        j                  j                  |t        j                  j                  |j                  j                                    |j                  |j                  |j                        S )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|  )r  r   r~  rz   r4  r  r  r  r  r   r"   r#   r  s     r)   rK  zTypeAlias.from_typeddict_type`  s     """"--,,$**66tyy7J7JK .  MMIIKK

 
	
r+   c                >    | j                   j                  d      d   S Nr   r1   r   r   s    r)   rk   zTypeAlias.nameu      ~~##C(,,r+   c                    | j                   S r'   r   r   s    r)   r   zTypeAlias.fullnamey  r   r+   c                :    t        d | j                  D              S )Nc              3  d   K   | ](  }t        |t        j                  j                         * y wr'   )r-   rz   r4  r  )ri   r  s     r)   rl   z0TypeAlias.has_param_spec_type.<locals>.<genexpr>  s$     UDTq:a!9!9:DT   .0)anyrs  r   s    r)   r  zTypeAlias.has_param_spec_type}  s    UDDTDTUUUr+   c           
        d| j                   | j                  j                         | j                  D cg c]  }|j                          c}| j                  | j
                  | j                  | j                  | j                  d	}|S c c}w )Nr   )	r   r   r/   rs  rt  ru  r"   r#   ry  )	r   r/   r   rs  rt  ru  r"   r#   ry  )r(   r  r   s      r)   r   zTypeAlias.serialize  su    !kk++-373C3CD3CaAKKM3CD||//IIkk&*&A&A

  Es   B	
c                $    |j                  |       S r'   )visit_type_aliasr   s     r)   ry   zTypeAlias.accept  r  r+   c           
        |d   dk(  sJ |d   }|d   D cg c]!  }t         j                  j                  |      # }}t        d |D              sJ t         j                  j                  |d         }|d   }|d   }|d	   }|d
   }	|d   }
 | ||||	t	        t
        t         j                  j                     |      |||
      S c c}w )Nr   r   r   rs  c              3  d   K   | ](  }t        |t        j                  j                         * y wr'   )r-   rz   r4  r  )ri   r  s     r)   rl   z(TypeAlias.deserialize.<locals>.<genexpr>  s"     Rk:a!;!;<kr  r/   rt  ru  r"   r#   ry  )rs  rt  ru  ry  )rz   r4  r5  rA  r   r   r  )r   r   r   r  rs  r/   rt  ru  r"   r#   ry  s              r)   r   zTypeAlias.deserialize  s    H~,,,
#?CM?RS?R!tzz2215?RSRkRRRR,,T(^<y/,'
F|h!%&>!?T$**"<"<={K!#9	
 		
 Ts   &C)r/   r"  r   r   r"   r.   r#   r.   rs  r  rt  r   ru  r   rw  r   ry  r   r2   r3   )r  r   r2   r   r   r   r   r   )r   r?   r2   r   )r7   r8   r9   r:   r;   r   r*   r   rG  rK  r   rk   r   r  r   ry   r   r   r   s   @r)   r   r     s   Vp
I BN @D ','' ' 	'
 ' =' ' ' ' !%' 
'> 
 
( 
 
( - -   V V. 
 
r+   r   c                  h    e Zd ZdZdZdd	 	 	 	 	 	 	 	 	 ddZedd       Zedd       ZddZ	dd	Z
y
)PlaceholderNodea  Temporary 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.
    )r   r  becomes_typeinfoF)r  c               <    || _         || _        || _        || _        y r'   )r   r  r  r"   )r(   r   r  r"   r  s        r)   r*   zPlaceholderNode.__init__  s!     "	 0	r+   c                >    | j                   j                  d      d   S r  r   r   s    r)   rk   zPlaceholderNode.name  r  r+   c                    | j                   S r'   r   r   s    r)   r   zPlaceholderNode.fullname  r   r+   c                    J d       )Nz#PlaceholderNode can't be serializedr<   r   s    r)   r   zPlaceholderNode.serialize  s    ;;;ur+   c                $    |j                  |       S r'   )visit_placeholder_noder   s     r)   ry   zPlaceholderNode.accept  r/  r+   N)
r   r   r  rt   r"   r.   r  r   r2   r3   r   r   r   )r7   r8   r9   r:   r;   r*   r   rk   r   r   ry   r<   r+   r)   r  r    su    .` :I QV#'/2IM	 - -  <4r+   r  c                      e Zd ZdZdZ	 	 	 dddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZedd       Zedd       ZddZ	dd	Z
dd
Zedd       Zy)r   a  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 <module> 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.
    )rG  r  module_publicmodule_hidden	cross_refimplicitplugin_generatedno_serializeF)r  r  c               t    || _         || _        || _        || _        || _        d | _        || _        || _        y r'   )rG  r  r  r  r  r  r  r  )r(   rG  r  r  r  r  r  r  s           r)   r*   zSymbolTableNode.__init__;  s@     		* *%) 0(r+   c                H    | j                   | j                   j                  S y r'   )r  r   r   s    r)   r   zSymbolTableNode.fullnameO  s    99 99%%%r+   c                    | j                   }t        |t        t        f      r|j                  |j                  S t        |t
              r|j                  j                  S y r'   )r  r-   rL  SYMBOL_FUNCBASE_TYPESr   r  r  )r(   r  s     r)   r   zSymbolTableNode.typeV  sI    yydS"789dii>S99i(88== r+   c                    t        | j                  | j                  | j                  | j                  | j
                        }| j                  |_        |S r'   )r   rG  r  r  r  r  r  )r(   news     r)   r)  zSymbolTableNode.copy`  sA    IItyy$"4"4dmmTEWEW
 
r+   c                B   t         | j                      dt        | j                         }t	        | j                  t
              r|d| j                  j                   dz  }| j                  |d| j                   z  }| j                  r|d| j                   z  }|S )N/rY  rV   : z cross_ref:)	rP   rG  r   r  r-   r   r   r   r  )r(   r>  s     r)   r   zSymbolTableNode.__str__g  s    $))$%Qz$))'<&=>dii,2dii(()++A99 3tyyk""A>>;t~~.//Ar+   c                   dt         | j                     d}| j                  rd|d<   | j                  sd|d<   | j                  rd|d<   | j
                  rd|d<   t        | j                  t              r| j                  j                  |d	<   |S | j                  J | d
|        || j                  j                  }d|v rg||dz   |z   k7  r\t        | j                  t              r| j                  j                  s,t        | j                  t              rJ d| d       ||d	<   |S | j                  j                         |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   )r   rG  Tr  Fr  r  r  r  :r   zDefinition of z is unexpectedly incompleter  )rP   rG  r  r  r  r  r-   r  r   r   rL  r  r  r   )r(   prefixrk   r   r   s        r)   r   zSymbolTableNode.serializer  sO    %6z$))?TU$(D!!!$)D!==#D  '+D#$dii* $		 2 2D   99(<VHAdV*<<(!99--8O FSL4$77'		37DII<Y<Y)		?  N'z1LMN  )1D%K99..0DLr+   c                6   |d   dk(  sJ t         |d      }d|v rt        |d       }|d   |_        n/d|v sJ |       t        j	                  |d         }t        ||      }d|v r
|d   |_        d|v r
|d   |_        d|v r
|d   |_        d	|v r
|d	   |_        |S )
Nr   r   rG  r  r  r  r  r  r  )	rQ   r   r  r   r   r  r  r  r  )r   r   rG  stnoder  s        r)   r   zSymbolTableNode.deserialize  s    H~!2222!$v,/$$T40F#K0FT>'4'>))$v,7D$T40Fd"#'#8F d"#'#8F ":.FO%&*+=&>F#r+   N)TFF)rG  r.   r  SymbolNode | Noner  r   r  r   r  r   r  r   r  r   r2   r3   )r2   r&  r  )r2   r   r   )r  r   rk   r   r2   r?   )r   r?   r2   r   )r7   r8   r9   r:   r;   r*   r   r   r   r)  r   r   r   r   r<   r+   r)   r   r     s    9v	I ##) "'"))  ) 	)
 ) ) ) ) 
)(    	!F  r+   c                  >    e Zd ZdZdZddZd	dZd
dZedd       Z	y)r   zrStatic representation of a namespace dictionary.

    This is used for module, class and function namespaces.
    r<   c                   g }| j                         D ]  \  }}t        |t              rf|j                  dk7  s&|j                  xs dj	                  d      d   t
        vsO|j                  dt        |      z   dz   t        |      z          ||j                  d        t        |      }|j                  dd	       |dxx   d
z  cc<   dj                  |      S )Nbuiltinsrf   r   r1   z  r  z  <invalid item>r   zSymbolTable(rV  
)r!  r-   r   r   r   rW   r  r   r$  insertr[  )r(   ar{  r  s       r)   r   zSymbolTable.__str__  s    **,JC%1NNj0-244S9"=EZZHHTCH_u4s5zAB+, ' 1I	N#	"yy|r+   c           	         t        | j                         D cg c]  \  }}||j                         f c}}      S c c}}w r'   )r   r!  r)  )r(   r{  r  s      r)   r)  zSymbolTable.copy  s4    

M93S$))+.MNNMs   =
c                    ddi}| j                         D ],  \  }}|dk(  s|j                  r|j                  ||      ||<   . |S )Nr   r   __builtins__)r!  r  r   )r(   r   r   r{  r  s        r)   r   zSymbolTable.serialize  sP    "M2**,JC
 n$(:(:#6DI ' r+   c                    |d   dk(  sJ t               }|j                         D ]#  \  }}|dk7  st        j                  |      ||<   % |S )Nr   r   )r   r!  r   r   )r   r   ri  r{  r  s        r)   r   zSymbolTable.deserialize  sQ    H~...]**,JCh)55e<3 ' 	r+   Nr   )r2   r   )r   r   r2   r?   )r   r?   r2   r   )
r7   r8   r9   r:   r;   r   r)  r   r   r   r<   r+   r)   r   r     s2    
 I"O
  r+   r   c                  Z    e Zd ZdZdZdddddd	 	 	 	 	 	 	 	 	 	 	 ddZd	dZed
d       Zy)r  zSpecifies how a dataclass-like transform should be applied. The fields here are based on the
    parameters accepted by `typing.dataclass_transform`.
eq_defaultorder_defaultkw_only_defaultfrozen_defaultfield_specifiersN)r  r  r  r  r  c               ~    ||nd| _         ||nd| _        ||nd| _        ||nd| _        ||| _        y d| _        y )NTFr<   r  )r(   r  r  r  r  r  s         r)   r*   zDataclassTransformSpec.__init__  sW     )3(>*D.;.G]U2A2MSX0>0JnPU4D4P 0VXr+   c                    | j                   | j                  | j                  | j                  t	        | j
                        dS )Nr  )r  r  r  r  r   r  r   s    r)   r   z DataclassTransformSpec.serialize  s<    //!//#33"11 $T%:%: ;
 	
r+   c                    t        |j                  d      |j                  d      |j                  d      |j                  d      t        |j                  dg                   S )Nr  r  r  r  r  r  )r  r   tupler  s     r)   r   z"DataclassTransformSpec.deserialize  sU    %xx-((?3 HH%6788$45"488,>#CD
 	
r+   )r  r   r  r   r  r   r  ztuple[str, ...] | Noner  r   r2   r3   r   )r   r?   r2   r  )	r7   r8   r9   r:   r;   r*   r   r   r   r<   r+   r)   r  r    s    <I #'%)'+37 '+Y  Y #	Y
 %Y 1Y $Y 
Y$
 
 
r+   r  c                F    |D cg c]  }t        | |      s| c}S c c}w r'   )getattr)r  r   rk   s      r)   r1  r1    s#    ":UTgdD&9DU:::s   c                ,    |D ]  }t        | |d        y )NT)setattr)r  r0  rk   s      r)   r7  r7    s    dD! r+   c                    d}t        | j                  t              r| j                  j                  }n/t        | j                  t              rt        | j                        }|y| d| j                   S )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   )r-   r   r  rk   r  get_member_expr_fullname)r   initials     r)   r  r    s]     G$))X&))..	DIIz	**4995Ya		{##r+   r   c                `   d}d}d}d}t        | |      D ]  \  }}|t        k(  r|s|s|s|s |d|        y |t        k(  r|s|s|r |d|        y d}@|t        k(  r|s|s|r |d|        y d}]|t        k(  s	|t
        k(  rd}|st |d|        y |t        k(  s|r |d|        y d} 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)ziprm  rn  r  r  r  r  )	re  nodesfail
is_var_arg	is_kw_arg
seen_namedseen_optrG  r  s	            r)   check_arg_kindsr  3  s     JIJH)U+
d7?Y*^ W_Y*UW[\HXY*FMJY$-"7JDdKY>EI7 ,r+   c                    t               }t        | |      D ]-  \  }}|||v r |d| d| |        y |j                  |       / y )NzDuplicate argument "z" in )r   r  r#  )r   r  r  r_  
seen_namesrk   r  s          r)   check_arg_namesr  X  sT     #&%J%'
d
 2'vU;-@$Gt	 (r+   c                d    t        | j                  t              r| j                  j                  S y)z.Return whether the expression is ClassVar[...]F)r-   r  rL  r  r  s    r)   is_class_varr  f  s#    $))S!yy$$$r+   c                ^    t        | t        t        t        t        f      xr | j
                  S )z6Check whether `node` corresponds to a final attribute.)r-   rL  r  r   r  r  r  s    r)   is_final_noder  m  s"    dS'+<iHI[dmm[r+   c              #  0  K   | j                         D ]}  \  }}|}d|v r|j                  d      d   }|dz   |z   }|j                  }|s7|j                  |k(  sG|||f t	        |t
              s_t        |j                  ||      E d{     y7 w)zIterate over local definitions (not imported) in a symbol table.

    Recursively iterate over class members and nested classes.
    z-redefr   r   N)r!  r   r  r   r-   r   r   r   )r   name_prefixr  rk   symnode	shortnamer   r  s           r)   r   r   r  s      g	t

8,Q/I$y0||DMMX-GT))$),TZZ4HHH ' Is$   AB
BB2BBB)ro   ztuple[int, int]r2   zdict[str, str])r  r  r2   zTypeGuard[list[StrExpr]])r  rt   r   r  r2   r  )r  rt   r0  r  r2   r3   )r   r  r2   r&  )re  r  r  list[T]r  Callable[[str, T], None]r2   r3   )zfunction definition)
r   zSequence[str | None]r  r  r  r  r_  r   r2   r3   )r   r  r2   r   )r  r  r2   r   r'   )r   r   r  r   r  r;  r2   r   )r:   
__future__r   r   abcr   collectionsr   enumr   r   typingr   r	   r
   r   r   r   r   r   r   r   r   r   r   typing_extensionsr   r>   r   mypy_extensionsr   mypy.strconvrz   mypy.optionsr   	mypy.utilr   r   mypy.visitorr   r   r   mypy.patternsr   r    
mypy.typesr=   r   r?   rU   r@   rB   rD   rF   rG   rH   rI   rJ   rK   rP   r!  rQ   rW   ra   rc   rd   re   rg   updaterp   rq   rr   rt   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r   rC  rP  rQ  rR  rT  r`  rb  r~  r  r  r  r  r  r  r  rL  r  r  r  ro  r  r
  r  r  r*  r5  r;  rA  rF  rK  rO  rS  rZ  r`  rk  rs  r}  r  r  r  r  r  r  r  r  r  r  r  rO  rm  rn  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r+  r1  r9  r  rF  rN  rT  rY  r^  rj  ru  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  	frozensetr  r  r   r1  r  r  r  rq  r  r   r   r  r1  r7  r  globalsr   r-   
issubclassr   r   r  r  r  r  r   )r  _kindr{  objs   0000r)   <module>r     s	   : " 	  #     A !    2 I I%%) %)P  CLCH~* % eee  %  U u U e 
E 64v?OQbc
E c>H>N>N>PQ>PleUUE\>PQ E Q #"%  u  #" ,-+3'3*e   (>w&G e G
 &?'5	$ 5  #" ,	"   .<SUV % V   N9K9K9MN N./^$?
!    U :7 :( : : : : : :Z   
  D D D< s$5x
7KKL
J LIz IX" "2*Z *"/ /*.
 .& M L4t 4n !!78j 8H=*i H=V"Wt "WL u   U  $ ' *  7!x 7!t & ) u  e U  U ph
I pj +G4 A&
I A&H	5 2~* ~Bny nb/ /"19 1")I ),3Y 3"@3Y @3F<Y <*.	 .&3,i 3,l/ // /",i ,.	 .19 1-y -+Y +&.	 .$",i ",J-y -B.	 .83I 34,j ,.,j ,":.
 .4.
 ."0* 0",: ,-z -**j *Z6w 6./ /( 5d 5 5<     ""% "$$	5 $$$	5 $,,u ,!-z !-H3J 3.
 ..
 .:.
 .,3Z 3 ++Z ++\3Z 3:.
 .:-z -&4Z 4&/ /8.
 .*: 0-z -"-z -".
 .&,j ,"2J 2@6
 6"5z 5" <j  <F4j 4*4j 48 	5 	5 u  E .j* .b:
/ :
z
O 
</
 /
d3J 3"3Z 3*2J 2$2: 2.1* 10* 02.
 .(-z -F '0' e $ #,,P"Q % Q}z }@Cx CB  ((=>_ >$,-G$H / H ()M No N"#OP % Pb

 b
JG4j G4Tu up/$sO+, /d/
 /
d;"
$$ IOO%%SCy 33
#: % ""%,"4L"	"R -	 # 	
 
\ CGII%(I0?III@ Rv}s   7_#$8_)