
    hi                      U d Z ddlmZ ddl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 ddl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!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z; ddl<m=Z=m>Z>m?Z? ddl@mAZAmBZBmCZC erddlDmEZE  G d d          ZFerddlGZ ed          ZHeIeJef         ZKdeLd<   dZMdeLd<   dZNdeLd<   dZOdeLd<   dZPdeLd<   dZQdeLd<   dZRdeLd<   dZSdeLd<   dZTdeLd <   dZUdeLd!<   eMd"eNd#eOd$ePd%iZVdeLd&<   d' eVW                                D             ZXdeLd(<   d)ddd)d)ddd*ZYdeLd+<   d,d-d.d/d0d1d2d3d4d5d6
ZZdeLd7<   d8d9iZ[deLd:<   d4d5d;Z\deLd<<   d=d>d?d@dAZ]deLdB<   dCZ^deLdD<   dEZ_deLdF<    G dG dHeF          Z`e G dI dJe`                      Zae G dK dLe`                      Zb G dM dNeb          ZcebZddeLdO<   e G dP dQe`                      ZeefeJdRedS         f         ZgdeLdT<    G dU dVee          Zh G dW dXea          Zi G dY dZei          Zj G d[ d\ei          Zk G d] d^ei          Zlg d_ZmdeLd`<    G da dbe`          Znedc         ZodeLdd<    G de dfeneeea          Zp G dg dhe`          ZqdZrdeLdi<   dZsdeLdj<   dZtdeLdk<    G dl dm          Zuemg dnz   ZvdeLdo<    G dp dqen          Zwevg drz   ZxdeLds<   dZydeLdt<   dZzdeLdu<   dZ{deLdv<    G dw dxeweeea          Z|epe|fZ}deLdy<    G dz d{eeea          Z~g d|ZdeLd}<    G d~ dee          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d dea          Z G d deb          Z G d deb          ZdpdZ G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d de          Z G d de          Ze G dÄ de                      Zej        ZdeLd<   ej        ZdeLd<   ej        ZdeLd<   ej        ZdeLd<   ej        ZdeLd<   ej        ZdeLd<   eeeeeefZdeLd<    G d̄ deb          Z G d΄ deb          Z G dЄ deb          Z G d҄ deb          Z G dԄ deb          Z G dք deb          Z G d؄ deb          Z G dڄ deb          Z G d܄ deb          Z G dބ deb          Z G d deb          Z G d deb          Z G d deb          Z G d deweb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          ZdZdeLd<   dZdeLd<   dZdeLd<   dZdeLd<    G d  deeeb          ZefZdeLd<    G d deŦ          Z G d deŦ          Z G d deŦ          Z G d	 d
eb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z G d deb          Z eh d          ZdeLd<    eh d          ZdeLd<    G d dSee          Z G d deզ          Z e֐d           Zאd!eLd"<    e֐d#          Zؐd!eLd$<    e֐d%          Zِd!eLd&<    e֐d'          ZdeLd(<    G d) d*ee          Z G d+ d,ee          Z G d- dR          Z G d. d/eIeJef                   Z G d0 d1          Zސdqd5Zߐdrd8Zdsd;Zdsd<Zdtd?Zd@  e            W                                D             ZdeLdA<   dudHZ	 dvdwdMZdxdOZdydQZdzdTZ	 d{d|dYZdZdZeLd[<   dZdZeLd\<   dZdZeLd]<   dZdZeLd^<   d_ZdZeLd`<   daZdZeLdb<   dcZdZeLdd<   deZdZeLdf<   dgZdZeLdh<   diZdZeLdj<   dkZdZeLdl<   d}dnZd~doZdS (  z4Abstract syntax tree node classes (i.e. parse tree).    )annotationsN)abstractmethod)defaultdict)IteratorSequence)Enumunique)TYPE_CHECKINGAnyCallableFinalOptionalTypeVarUnioncast)	TypeAlias	TypeGuard)trait)LITERAL_COMPLEXLITERAL_NONEBufferTag	read_bool
read_floatread_intread_int_listread_int_optread_literalread_strread_str_listread_str_optread_str_opt_listread_tag
write_bool	write_intwrite_int_listwrite_int_optwrite_literal	write_strwrite_str_listwrite_str_optwrite_str_opt_list	write_tag)Options)	is_sunderis_typeshed_file
short_type)ExpressionVisitorNodeVisitorStatementVisitor)Patternc                  0    e Zd ZdZdZddd	Z	 	 	 dddZd
S )Contextz@Base type for objects that are valid as error message locations.linecolumnend_line
end_columnr9   intr:   returnNonec                >    || _         || _        d | _        d | _        d S Nr8   )selfr9   r:   s      Z/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/mypy/nodes.py__init__zContext.__init__9   s"    	$(&*    NtargetContext | int
int | Noner;   r<   c                    t          |t                    r|| _        n0|j        | _        |j        | _        |j        | _        |j        | _        ||| _        ||| _        |	|| _        dS dS )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)
isinstancer>   r9   r:   r;   r<   )rC   rG   r:   r;   r<   s        rD   set_linezContext.set_line?   sw     fc"" 	0DIIDI -DK"ODM$/DO DK$DM!(DOOO "!rF   )r=   r=   )r9   r>   r:   r>   r?   r@   NNN
rG   rH   r:   rI   r;   rI   r<   rI   r?   r@   )__name__
__module____qualname____doc__	__slots__rE   rL    rF   rD   r7   r7   4   s\        JJ<I+ + + + + "#!%) ) ) ) ) ) )rF   r7   T
_TypeAliasJsonDictr   LDEF   GDEF   MDEF   UNBOUND_IMPORTEDREVEAL_TYPEREVEAL_LOCALSLITERAL_YESLITERAL_TYPE
LITERAL_NOLdefGdefMdefUnboundImported
node_kindsc                    i | ]\  }}||	S rT   rT   ).0_name_kinds      rD   
<dictcomp>rm      s    QQQleUUEQQQrF   inverse_node_kindsz__builtins__.str)rO   rR   __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}   )r]      type_aliases_source_versions)ztyping_extensions.OrderedDictztyping_extensions.LiteralStringtyping_extensions_aliasesry   rz   r{   r|   )ru   rv   rw   rx   reverse_builtin_aliases)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dS )Nodez4Common base class for all non-type parse tree nodes.rT   r?   strc                    |                      t          j                            t	                                          S Noptions)acceptmypystrconvStrConvr.   rC   s    rD   __str__zNode.__str__   s+    {{4<//		/BBCCCrF   r   r.   c                t    |                      t          j                            |                    }|sJ |S r   )r   r   r   r   )rC   r   as      rD   str_with_optionszNode.str_with_options   s4    KK,,W,==>>rF   visitorNodeVisitor[T]rU   c                <    t          dt          |                     NzNot implementedRuntimeErrortyperC   r   s     rD   r   zNode.accept       ,d4jj999rF   Nr?   r   )r   r.   r?   r   r   r   r?   rU   )rO   rP   rQ   rR   rS   r   r   r   rT   rF   rD   r   r      s_        >>ID D D D   
: : : : : :rF   r   c                      e Zd ZdZdZd	dZdS )
	StatementzA statement node.rT   r   StatementVisitor[T]r?   rU   c                <    t          dt          |                     r   r   r   s     rD   r   zStatement.accept   r   rF   Nr   r   r?   rU   rO   rP   rQ   rR   rS   r   rT   rF   rD   r   r      s3        I: : : : : :rF   r   c                      e Zd ZdZdZd	dZdS )

ExpressionzAn expression node.rT   r   ExpressionVisitor[T]r?   rU   c                <    t          dt          |                     r   r   r   s     rD   r   zExpression.accept   r   rF   Nr   r   r?   rU   r   rT   rF   rD   r   r      s3        I: : : : : :rF   r   c                      e Zd ZdZdZdS )FakeExpressionzA dummy expression.

    We need a dummy expression in one place, and can't instantiate Expression
    because it is a trait and mypyc barfs.
    rT   N)rO   rP   rQ   rR   rS   rT   rF   rD   r   r      s          IIIrF   r   Lvaluec                      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ddZe
dd            ZdS )
SymbolNodez+Nodes that can be stored in a symbol table.rT   r?   r   c                    d S rB   rT   r   s    rD   namezSymbolNode.name   	     	rF   c                    d S rB   rT   r   s    rD   fullnamezSymbolNode.fullname   r   rF   rW   c                    d S rB   rT   r   s    rD   	serializezSymbolNode.serialize  s    rF   datac                    |d         }t                               |          }| ||          S t          d|           )N.classzunexpected .class )deserialize_mapgetNotImplementedError)clsr   	classnamemethods       rD   deserializezSymbolNode.deserialize  sI    N	 $$Y//6$<<!"By"B"BCCCrF   r   r@   c                <    t          d| j        j         d          )NzCannot serialize 	 instance)r   	__class__rO   rC   r   s     rD   writezSymbolNode.write  s!    !"Xdn6M"X"X"XYYYrF   c                2    t          d| j         d          )NzCannot deserialize r   )r   rO   r   r   s     rD   readzSymbolNode.read  s    !"O"O"O"OPPPrF   Nr   r?   rW   )r   rW   r?   r   r   r   r?   r@   )r   r   r?   r   )rO   rP   rQ   rR   rS   propertyr   r   r   r   classmethodr   r   r   rT   rF   rD   r   r      s        55I   ^ X    ^ X    ^ D D D [DZ Z Z Z Q Q Q [Q Q QrF   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<   	 	 d9d: fd#Zd;d%Ze	d<d&            Z
e	d<d'            Zd=d+Zd>d,Zd?d.Zd@d1ZdAd3ZedBd5            ZdCd7ZedDd8            Z xZS )E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)r   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   FNdict[int, list[str]] | Noner?   r@   c                   t                                                       || _        d| _        d| _        || _        || _        t          t                    | _	        i | _
        |r|| _        ni | _        t                      | _        d| _        d| _        d| _        d| _        t                      | _        d | _        d S )NrY   r    F)superrE   r   r9   r:   r   r   r   setr   r   r   r   r   r   r   r   r   r   )rC   r   r   r   r   r   s        rD   rE   zMypyFile.__init__T  s     			%c** 	$!.D!#D UU	!&',$#&55 !%rF   Iterator[Definition]c                6    t          | j        | j                  S )zyReturn all definitions within the module (including nested).

        This doesn't include imported definitions.
        )local_definitionsr   r   r   s    rD   r   zMypyFile.local_definitionsp  s    
 !T];;;rF   c                T    | j         sdn| j                             d          d         S )Nr   .r=   r   splitr   s    rD   r   zMypyFile.namew  s(    JrrT^-A-A#-F-Fr-JJrF   c                    | j         S rB   r   r   s    rD   r   zMypyFile.fullname{  
    ~rF   r   r   rU   c                ,    |                     |           S rB   )visit_mypy_filer   s     rD   r   zMypyFile.accept      &&t,,,rF   c                    t          | j                  dk    o6t          j                            | j                                      d          S )Nr   z	__init__.)lenr   osbasename
startswithr   s    rD   is_package_init_filezMypyFile.is_package_init_file  s:    49~~"Zrw'7'7	'B'B'M'Mk'Z'ZZrF   flagc                    || j         v S rB   )r   )rC   r   s     rD   is_future_flag_setzMypyFile.is_future_flag_set  s    t///rF   r   r.   c                \    | j         t          |j        | j                  | _         | j         S rB   )r   r0   abs_custom_typeshed_dirr   rC   r   s     rD   r0   zMypyFile.is_typeshed_file  s-    !)%5g6UW[W`%a%aD"%%rF   rW   c           	         d| j         | j                            | j                   | j        | j        | j        t          | j                  dS )Nr   )r   r   r   r   r   r   r   )r   r   r   r   r   r   sortedr   r   s    rD   r   zMypyFile.serialize  sL     Z))$.99|I'+'C#)$*B#C#C
 
 	
rF   r   c                F   |d         dk    s
J |            t          g g           }|d         |_        t                              |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      rD   r   zMypyFile.deserialize  s    H~+++T+++Bk* ,,T'];;
IL	'+,E'F$!%#&t,A'B#C#C rF   r   c                \   t          |t                     t          || j                   | j                            || j                   t          || j                   t          || j                   t          || j	                   t          |t          | j                             d S rB   )r-   	MYPY_FILEr)   r   r   r   r$   r   r   r   r*   r  r   r   s     rD   r   zMypyFile.write  s    $	"""$'''
t~...4&&&$	"""45666tVD$<==>>>>>rF   c                   t          |          t          k    sJ t          g g           }t          |          |_        t
                              |          |_        t          |          |_	        t          |          |_
        t          |          |_        t          t          |                    |_        d|_        |S NT)r#   r
  r   r   r   r   r   r   r   r   r   r   r   r    r   r   r  s      rD   r   zMypyFile.read  s    ~~****B!$ %%d++
 TNN	'0$#&}T':':#;#; !%rF   )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   rW   r?   r   r   )r   r   r?   r   )rO   rP   rQ   rR   rS   __match_args__rr   rE   r   r   r   r   r   r   r   r0   r   r   r   r   r   __classcell__r   s   @rD   r   r     s$        ;;I$ .N NNNIII****LLL (''' MMM "!!!$$$$!!!!"""" 59& & & & & & &8< < < < K K K XK    X- - - -[ [ [ [0 0 0 0& & & &	
 	
 	
 	
 
 
 
 [
? ? ? ? 
 
 
 [
 
 
 
 
rF   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  r?   r@   c                    t                                                       g | _        d| _        d| _        d| _        d S NF)r   rE   r  r  r  r  rC   r   s    rD   rE   zImportBase.__init__  s?    #!!rF   r?   r@   )rO   rP   rQ   rR   rS   rr   rE   r  r  s   @rD   r  r    s|         //QI &%%%" " " " " " " " " "rF   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  r?   r@   c                V    t                                                       || _        d S rB   )r   rE   r  )rC   r  r   s     rD   rE   zImport.__init__  s$    rF   r   r   rU   c                ,    |                     |           S rB   )visit_importr   s     rD   r   zImport.accept  s    ##D)))rF   )r  r  r?   r@   r   
rO   rP   rQ   rR   rS   r  rr   rE   r   r  r  s   @rD   r  r    so         IN%%%%     * * * * * * * *rF   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   r?   r@   c                r    t                                                       || _        || _        || _        d S rB   )r   rE   r%  r   r&  )rC   r%  r&  r   r   s       rD   rE   zImportFrom.__init__  s2    
 rF   r   r   rU   c                ,    |                     |           S rB   )visit_import_fromr   s     rD   r   zImportFrom.accept      ((...rF   )r%  r   r&  r>   r   r  r?   r@   r   r"  r  s   @rD   r$  r$    s         %%+I0NGGGMMM''''! ! ! ! ! !/ / / / / / / /rF   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&  r?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   r%  r&  )rC   r%  r&  r   s      rD   rE   zImportAll.__init__  s+     rF   r   r   rU   c                ,    |                     |           S rB   )visit_import_allr   s     rD   r   zImportAll.accept      ''---rF   )r%  r   r&  r>   r?   r@   r   r"  r  s   @rD   r,  r,    su         "I'NGGGMMM! ! ! ! ! !
. . . . . . . .rF   r,  )is_propertyis_class	is_staticis_finalFUNCBASE_FLAGSc                       e Zd ZdZdZd fdZeedd                        Z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infor1  r2  r3  r4  is_explicit_overrideis_type_check_onlyr   r?   r@   c                    t                                                       d | _        d | _        t          | _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        d S )NFr   )r   rE   r   r8  FUNC_NO_INFOr9  r1  r2  r3  r4  r:  r;  r   r  s    rD   rE   zFuncBase.__init__-  sk     37	=A 	  $)!"'rF   r   c                    d S rB   rT   r   s    rD   r   zFuncBase.nameA  r   rF   c                    | j         S rB   r   r   s    rD   r   zFuncBase.fullnameF  r   rF   r   c                (    | j          p
| j        dk    S )a  If used as a method, does it have an argument for method binding (`self`, `cls`)?

        This is true for `__new__` even though `__new__` does not undergo method binding,
        because we still usually assume that `cls` corresponds to the enclosing class.
        __new__)r3  r   r   s    rD   has_self_or_cls_argumentz!FuncBase.has_self_or_cls_argumentJ  s     >!;TY)%;;rF   r  r   r  )rO   rP   rQ   rR   rS   rE   r   r   r   r   rB  r  r  s   @rD   r7  r7    s         I     (    ^ X    X < < < X< < < < <rF   r7  )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
ed<   d! f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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setter_index_is_trivial_selflist[OverloadPart]rH  rI  zOverloadPart | NonerJ  
str | NonerK  rI   rL  r?   r@   c                    t                                                       || _        |                                | _        d | _        d | _        d | _        d | _        |r.| 	                    |d         j
        |d         j                   d S d S Nr   )r   rE   rH  copyrI  rJ  rK  rL  rM  rL   r9   r:   rC   rH  r   s     rD   rE   zOverloadedFuncDef.__init__p  s    
 %

	 -1 	:MM%(-q99999	: 	:rF   r   c                ^    | j         r| j         d         j        S | j        J | j        j        S rQ  )rH  r   rJ  r   s    rD   r   zOverloadedFuncDef.name|  s5    : 	":a=%% 9(((9>!rF   r   c                0   | j         | j         S t          | j                  D ]k\  }}|dk    s| j        sdnd}t	          |t
                    r|j        s
d| _          dS =t          |j                  |k    s|j	        j        s
d| _          dS ld| _         dS )zCheck we can use bind_self() fast path for this overload.

        This will return False if at least one overload:
          * Has an explicit self annotation, or Self in signature.
          * Has a non-trivial decorator.
        Nr   rY   FT)
rM  	enumeraterH  r1  rK   rC  is_trivial_selfr   
decoratorsfunc)rC   iitemtrivials       rD   rW  z!OverloadedFuncDef.is_trivial_self  s      ,(( ,, 		 		GAtq55(85aaaG$(( + !,1D) 55! T_%%//ty7P/(-%uu 0 !%trF   rD  c                    | j         d         }t          |t                    sJ |j        j        sJ | j        J | j         | j                 }t          |t                    sJ |S rQ  )rH  rK   rD  varis_settable_propertyrL  )rC   
first_itemr[  s      rD   setterzOverloadedFuncDef.setter  so     Z]
*i00000~2222 ,,,z$+,$	*****rF   r   r   rU   c                ,    |                     |           S rB   )visit_overloaded_func_defr   s     rD   r   zOverloadedFuncDef.accept      00666rF   rW   c           	         dd | j         D             | j        d n| j                                        | j        | j        d n| j                                        t          | t                    | j        | j        dS )NrG  c                6    g | ]}|                                 S rT   r   )rj   rZ  s     rD   
<listcomp>z/OverloadedFuncDef.serialize.<locals>.<listcomp>       888akkmm888rF   )r   rH  r   r   rJ  flagsrK  rL  )	rH  r   r   r   rJ  	get_flagsr5  rK  rL  r   s    rD   r   zOverloadedFuncDef.serialize  s|    )88TZ888 I-DD493F3F3H3H I-DD493F3F3H3Ht^44/ -	
 	
 		
rF   r   c                   |d         dk    sJ t          d |d         D                       }|                    d          ot          t          t                              |d                             |_        t          |j                  dk    r|	                    |j        j
                   |                    d          Mt          j                            |d                   }t          |t          j        j                  sJ ||_        |d         |_        t%          ||d	                    |d
         |_        |d         |_        |S )Nr   rG  c                h    g | ]/}t          t          t                              |                    0S rT   )r   rE  r   r   )rj   ds     rD   rh  z1OverloadedFuncDef.deserialize.<locals>.<listcomp>  s0    RRRqT,
 6 6q 9 9::RRRrF   rH  rJ  r   r   r   rj  rK  rL  )rG  r   r   rE  r   r   rJ  r   rH  rL   r9   r   typesdeserialize_typerK   
ProperTyper   r   	set_flagsrK  rL  r   r   restyps       rD   r   zOverloadedFuncDef.deserialize  s'   H~!44444RRDMRRR
 
 88F'L**@*@f*N*NOOCH39~~!!SX]+++88F'*--d6l;;Cc4:#899999CHZ(#tG}%%%l+/
rF   r   c                *   t          |t                     t          |t          | j                             | j        D ]}|                    |           t          j                            || j	                   t          || j                   | j        t          |d           n*t          |d           | j                            |           t          || t                     t!          || j                   t%          || j                   d S )NFT)r-   OVERLOADED_FUNC_DEFr%   r   rH  r   r   ro  write_type_optr   r)   r   rJ  r$   write_flagsr5  r+   rK  r'   rL  )rC   r   r[  s      rD   r   zOverloadedFuncDef.write  s    $+,,,$DJ(((J 	 	DJJt
!!$	222$'''9tU####tT"""IOOD!!!D$///dDO,,,dD-.....rF   c                \   t          fdt          t                              D                       }t          j                                      }|(t          |t          j        j                  sJ ||_        t                    |_
        t                    rKt                    |_        t          |j                  dk    r|                    |j        j                   t%          |t&                     t)                    |_        t-                    |_        |S )Nc                .    g | ]}t                    S rT   )read_overload_partrj   _r   s     rD   rh  z*OverloadedFuncDef.read.<locals>.<listcomp>  s"     Y Y Ya!3D!9!9 Y Y YrF   r   )rG  ranger   r   ro  read_type_optrK   rq  r   r   r   r   r|  rJ  r   rH  rL   r9   
read_flagsr5  r!   rK  r   rL  rs  s    `  rD   r   zOverloadedFuncDef.read  s     Y Y Y Y5RVCXCX Y Y YZZj&&t,,?c4:#899999CH T?? 	,)$//CH39~~!!SX]+++4n---%d++'--
rF   c                >    t          d | j        D                       S )Nc              3  >   K   | ]}|                                 V  d S rB   )
is_dynamicrj   r[  s     rD   	<genexpr>z/OverloadedFuncDef.is_dynamic.<locals>.<genexpr>  s,      <<4??$$<<<<<<rF   )allrH  r   s    rD   r  zOverloadedFuncDef.is_dynamic  s!    <<<<<<<<rF   )rH  rN  r?   r@   r   r  )r?   rD  r   r   )r   rW   r?   rG  r   )r   r   r?   rG  )rO   rP   rQ   rR   rS   rr   rE   r   r   rW  ra  r   r   r   r   r   r   r  r  r  s   @rD   rG  rG  W  s~         I ((((
: 
: 
: 
: 
: 
: " " " X"    X,    X7 7 7 7

 

 

 

    [*/ / / /     [$= = = = = = = =rF   rG  c                  D     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_onlyFr  Varr  mypy.types.Type | Noner  Expression | Noner  ArgKindr  r   r?   r@   c                    t                                                       || _        || _        || _        || _        || _        d S rB   )r   rE   r  r  r  r  r  )rC   r  r  r  r  r  r   s         rD   rE   zArgument.__init__  sD     	 .&	 rF   NrG   rH   r:   rI   r;   r<   c                B   t                                          ||||           | j        rA| j        j        dk     r1| j                            | j        | j        | j        | j                   | j                            | j        | j        | j        | j                   d S rQ  )r   rL   r  r9   r:   r;   r<   r  )rC   rG   r:   r;   r<   r   s        rD   rL   zArgument.set_line	  s     	:>>> 	^ 0 5 9 9%%didmT_]]]ty$+t}doVVVVVrF   F)r  r  r  r  r  r  r  r  r  r   r?   r@   rM   rN   )	rO   rP   rQ   rR   rS   r  rE   rL   r  r  s   @rD   r  r    s        **RIWN ! ! ! ! ! ! !$ "#!%W W W W W W W W W W WrF   r  TYPE_VAR_KINDPARAM_SPEC_KINDTYPE_VAR_TUPLE_KINDc                      e Zd ZdZddZdS )	TypeParamr   r  upper_boundvaluesdefaultr   r   r  r>   r  r  r  list[mypy.types.Type]r  r?   r@   c                L    || _         || _        || _        || _        || _        d S rB   r  )rC   r   r  r  r  r  s         rD   rE   zTypeParam.__init__!  s,     		&rF   N)r   r   r  r>   r  r  r  r  r  r  r?   r@   )rO   rP   rQ   rS   rE   rT   rF   rD   r  r    s-        DI     rF   r  )is_overloadis_generatoris_coroutineis_async_generatoris_awaitable_coroutineFUNCITEM_FLAGSc                  F     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)r  r  r  Nr  list[Argument] | Noner  Block | Noneru  mypy.types.FunctionLike | Noner  list[TypeParam] | Noner?   r@   c                   t                                                       |pg | _        d | j        D             | _        d | j        D             | _        | j                            t                    | j                            t                    z   | _        || _	        |pt          g           | _        || _        || _        d| _        d| _        d| _        d| _        d| _        g | _        d| _        t+          t-          | j                            D ]1}| j        |         "||                                 k     r
|dz   | _        2d S )Nc                8    g | ]}|j         rd n|j        j        S rB   )r  r  r   rj   args     rD   rh  z%FuncItem.__init__.<locals>.<listcomp>Y  s(    ```##,E$$CL4E```rF   c                    g | ]	}|j         
S rT   )r  r  s     rD   rh  z%FuncItem.__init__.<locals>.<listcomp>Z  s    (L(L(Lc(L(L(LrF   Fr   rY   )r   rE   r  r  r  countARG_POSARG_OPTr  r  Blockr  r   r8  r  r  r  r  r  r  r  r  r   max_fixed_argc)rC   r  r  ru  r  rZ  r   s         rD   rE   zFuncItem.__init__P  s;    	"b``QUQ_```(L(LT^(L(L(L N0099DN<P<PQX<Y<YY1:,599		"!&"'"'(-,1#(*s4>**++ 	& 	&A~a (Q1D1D1F1F-F-F !A	& 	&rF   r>   c                    | j         S rB   )r  r   s    rD   r  zFuncItem.max_fixed_argcl  s
    |rF   r   c                    | j         d u S rB   r   r   s    rD   r  zFuncItem.is_dynamico  s    yD  rF   )NNNN)
r  r  r  r  ru  r  r  r  r?   r@   )r?   r>   r  )
rO   rP   rQ   rR   rS   __deletable__rE   r  r  r  r  s   @rD   r  r  9  s        CCI$ 9M ,0!.2,0& & & & & & &8   ! ! ! ! ! ! ! !rF   r  )is_decoratedis_conditionalis_trivial_bodyrW  r  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d%dZed&d            Z xZS )'rC  zQFunction definition.

    This is a non-lambda function defined using 'def'.
    )rk   r  r  abstract_statusoriginal_defr  rW  has_self_attr_defr  dataclass_transform_spec	docstringrK  original_first_arg)r   r  r   r  r   Nr   r   r  r  r  r  ru  r  r  r  r?   r@   c                F   t                                          ||||           || _        d| _        d| _        t
          | _        d| _        d | _        d| _	        d | _
        d | _        d | _        d| _        d| _        |r|d         j        j        | _        d S d | _        d S )NFr   )r   rE   rk   r  r  r  r  r  r  r  r  r  rK  rW  r  r  r   r  )rC   r   r  r  ru  r  r   s         rD   rE   zFuncDef.__init__  s     	D#y999
!#+  %>B!GK%%)&*  %!&  	+2;A,2G2LD###&*D###rF   c                    | j         S rB   rk   r   s    rD   r   zFuncDef.name  
    zrF   r   r   rU   c                ,    |                     |           S rB   )visit_func_defr   s     rD   r   zFuncDef.accept      %%d+++rF   rW   c                   d| j         | j        | j        d | j        D             | j        d n| j                                        t          | t                    | j        | j	        d n| j	                                        | j
        | j        dS )NrC  c                6    g | ]}t          |j                  S rT   r>   valuerj   xs     rD   rh  z%FuncDef.serialize.<locals>.<listcomp>  s     ???1#ag,,???rF   )r   r   r   r  r  r   rj  r  r  rK  r  )rk   r   r  r  r   r   rk  r  r  r  rK  r  r   s    rD   r   zFuncDef.serialize  s      J????? I-DD493F3F3H3Ht]33#3 08 2<<>>/"&"9!
 
 	
rF   r   c                d   |d         dk    sJ t          g           }t          |d         g ||d         d nAt          t          j        j        t          j                            |d                                       }|d         |_        t          ||d                    |d         |_	        |
                    d          |_        d	 |d
         D             |_        |d         |_        |d          t                              |d                   nd |_        |d         |_        |`|`|`|S )Nr   rC  r   r   r   rj  r  r  c                (    g | ]}t           |         S rT   	ARG_KINDSr  s     rD   rh  z'FuncDef.deserialize.<locals>.<listcomp>  s    AAA!1AAArF   r  r  r  rK  )r  rC  r   r   ro  FunctionLikerp  r   rr  r  r   r  r  r  DataclassTransformSpecr   r  rK  r  r  r  )r   r   r  rets       rD   r   zFuncDef.deserialize  s:   H~****RyyL <' $*14:3N3NtTZ|3\3\]]	
 	
 Z(#tG}%%%[)!%*>!?!?AAtK/@AAA"#45 ./; #..t4N/OPPP 	$
 l+MKL
rF   r   c                d   t          |t                     t          || j                   t          j                            || j                   t          || j                   t          || t                     t          || j                   t          |d | j        D                        t          || j                   | j        t%          |d           n*t%          |d           | j                            |           t)          || j                   t)          || j                   d S )Nc                6    g | ]}t          |j                  S rT   r  rj   aks     rD   rh  z!FuncDef.write.<locals>.<listcomp>
  s     EEEc"(mmEEErF   FT)r-   FUNC_DEFr)   rk   r   ro  rx  r   r   ry  r  r,   r  r&   r  r%   r  r  r$   r   r+   rK  r  r   s     rD   r   zFuncDef.write  s   $!!!$
###
!!$	222$'''D$...4000tEEdnEEEFFF$,---(0tU####tT""")//555dDO,,,dD344444rF   c                Z   t          |          }d }t          |          rt          j                            |          }t          |g t          g           |          }t          |          |_        t          ||t                     t          |          |_        d t          |          D             |_        t          |          |_        t          |          rt                               |          |_        t'          |          |_        t'          |          |_        |`|`|`|S )Nc                (    g | ]}t           |         S rT   r  r  s     rD   rh  z FuncDef.read.<locals>.<listcomp>  s    EEE22EEErF   )r   r   r   ro  read_function_likerC  r  r   r  r  r"   r  r   r  r   r  r  r   r  r!   rK  r  r  r  r  )r   r   r   ru  r  s        rD   r   zFuncDef.read  s    ~~.2T?? 	6*//55CdBb		3// 4m,,,)$//EEt1D1DEEE&tnnT?? 	M+A+F+Ft+L+LC(%d++!-d!3!3MKL
rF   )r   NNNN)r   r   r  r  r  r  ru  r  r  r  r?   r@   r   r   r   )r   rW   r?   rC  r   )r   r   r?   rC  )rO   rP   rQ   rR   rS   r  rE   r   r   r   r   r   r   r   r   r  r  s   @rD   rC  rC    s	        
I" ;N
 +/!.2,0"+ "+ "+ "+ "+ "+ "+H    X, , , ,
 
 
 
4    [@5 5 5 5"    [    rF   rC  SYMBOL_FUNCBASE_TYPESc                  (    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ed-d"            Zd&d#Z xZS ).rD  zhA decorated function.

    A single Decorator object can include any number of function decorators.
    )rY  rX  original_decoratorsr^  r  )rX  r^  rY  rC  rY  list[Expression]rX  r  r  r^  r   r  r?   r@   c                    t                                                       || _        || _        |                                | _        || _        d| _        d S r  )r   rE   rY  rX  rR  r  r^  r  )rC   rY  rX  r^  r   s       rD   rE   zDecorator.__init__E  sN    	$#-??#4#4  rF   r   c                    | j         j        S rB   )rY  r   r   s    rD   r   zDecorator.nameM      y~rF   c                    | j         j        S rB   )rY  r   r   s    rD   r   zDecorator.fullnameQ      y!!rF   c                    | j         j        S rB   )rY  r4  r   s    rD   r4  zDecorator.is_finalU  r  rF   r   c                    | j         j        S rB   )rY  r9  r   s    rD   r9  zDecorator.infoY  r  rF   r  c                    | j         j        S rB   )r^  r   r   s    rD   r   zDecorator.type]  s    x}rF   r   r   rU   c                ,    |                     |           S rB   )visit_decoratorr   s     rD   r   zDecorator.accepta  r   rF   rW   c                v    d| j                                         | j                                        | j        dS )NrD  )r   rY  r^  r  )rY  r   r^  r  r   s    rD   r   zDecorator.serialized  s<    !I''))8%%''+	
 
 	
rF   r   c                    |d         dk    sJ t          t                              |d                   g t                              |d                             }|d         |_        |S )Nr   rD  rY  r^  r  )rD  rC  r   r  r  )r   r   decs      rD   r   zDecorator.deserializel  s\    H~,,,,++DL992stTY{?[?[\\}-
rF   r   c                    t          |t                     | j                            |           | j                            |           t          || j                   d S rB   )r-   	DECORATORrY  r   r^  r$   r  r   s     rD   r   zDecorator.writes  sS    $	"""	t4)*****rF   c                    t          |          t          k    sJ t                              |          }t          |          t          k    sJ t
                              |          }t          |g |          }t          |          |_        |S rB   )	r#   r  rC  r   VARr  rD  r   r  )r   r   rY  r^  r  s        rD   r   zDecorator.ready  ss    ~~))))||D!!~~$$$$hhtnnb#&&#D//
rF   c                4    | j                                         S rB   )rY  r  r   s    rD   r  zDecorator.is_dynamic      y##%%%rF   )rY  rC  rX  r  r^  r  r?   r@   r   r  )r?   r   r?   r  r   r   )r   rW   r?   rD  r   )r   r   r?   rD  )rO   rP   rQ   rR   rS   r  rr   rE   r   r   r   r4  r9  r   r   r   r   r   r   r   r  r  r  s   @rD   rD  rD  3  s         
 TI2NMMM    ))))HHH! ! ! ! ! !    X " " " X" " " " X"    X    X- - - -
 
 
 
    [+ + + +    [& & & & & & & &rF   rD  )is_selfis_clsis_initialized_in_classis_staticmethodis_classmethodr1  r_  is_suppressed_importis_classvaris_abstract_varr4  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                       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ddZedd            Zd dZed!d            Z xZS )"r  zPA variable.

    It can refer to global/local variable or a data attribute.
    )rk   r   r9  r   setter_typefinal_valuer  r  r  r  r  r  r	  r1  r_  r  r  r4  r  r  r  r
  r  r  r  r  r  )r   r   r  Nr   r   r   r  r?   r@   c                   t                                                       || _        d| _        t          | _        || _        d | _        d| _        d| _	        d| _
        | j        d u | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d S )Nr   FT)r   rE   rk   r   VAR_NO_INFOr9  r   r  r  r  r  r  r  r  r	  r1  r_  r  r  r  r
  r4  r  r  r  r  r  r  r  r  )rC   r   r   r   s      rD   rE   zVar.__init__  s   
	,0	;?9,',$$# $)! $! %*! GK$)!!& #(#(  #(+0( %*!!!rF   c                    | j         S rB   r  r   s    rD   r   zVar.name  r  rF   c                    | j         S rB   r   r   s    rD   r   zVar.fullname  r   rF   c                d    | j         p| j        }d|dt          t          |                      dS )Nz<Var z at >)r   r   hexr%  rC   r   s     rD   __repr__zVar.__repr__  s5    })	3t333r$xx==3333rF   r   r   rU   c                ,    |                     |           S rB   )	visit_varr   s     rD   r   z
Var.accept
  s      &&&rF   rW   c           	         d| j         | j        | j        d n| j                                        | j        d n| j                                        t          | t                    d}| j        
| j        |d<   |S )Nr  )r   r   r   r   r  rj  r  )rk   r   r   r   r  rk  r  r  r   s     rD   r   zVar.serialize  s     J I-DD493F3F3H3H#'#3#;44AQA[A[A]A]tY//
 
 '"&"2DrF   r   c                (   |d         dk    sJ |d         }|d         d n$t           j                            |d                   }|d         d n$t           j                            |d                   }t          ||          }|@t	          |t           j        j                  rt	          |t           j        j                  sJ ||_        d|_        |d         |_	        t          ||d                    |                    d	          |_        |S )
Nr   r  r   r   r  Fr   rj  r  )r   ro  rp  r  rK   rq  CallableTyper  r  r   rr  r   r  )r   r   r   r   r  vs         rD   r   zVar.deserialize  s	   H~&&&&F|F|+tt1L1LTRX\1Z1Z M"* D,,T--@AA 	
 dOO+tz'<==  ;
(?@@   $
:&!T']###//rF   r   c                n   t          |t                     t          || j                   t          j                            || j                   t          j                            || j                   t          || j	                   t          || t                     t          || j                   d S rB   )r-   r  r)   rk   r   ro  rx  r   r  r   ry  r  r(   r  r   s     rD   r   z	Var.write3  s    $$
###
!!$	222
!!$(8999$'''D$	***dD,-----rF   c                x   t          |          }t          j                            |          }t	          ||          }d }t          |          rHt          |          t          j        j        k    sJ t          j        j        	                    |          }||_
        d|_        t          |          |_        t          ||t                     t          |          }|t          k    r0t!          t#          |          t#          |                    |_        n |t&          k    rt)          ||          |_        |S r  )r   r   ro  r  r  r   r#   CALLABLE_TYPEr(  r   r  r  r   r  r  r   complexr   r  r   r   )r   r   r   ru  r)  r  markers          rD   r   zVar.read<  s    ~~j&&t,,cNN6:T?? 	=D>>TZ%=====*166t<<K#
tnn4I&&&$_$$#Jt$4$4j6F6FGGAMM|##(v66AMrF   rB   )r   r   r   r  r?   r@   r   r   r   )r   rW   r?   r  r   )r   r   r?   r  )rO   rP   rQ   rR   rS   r  rE   r   r   r   r#  r   r   r   r   r   r   r  r  s   @rD   r  r    s+        
I< 5N6* 6* 6* 6* 6* 6* 6*p    X    X4 4 4 4' ' ' '       [,. . . .    [    rF   r  c                  P    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<   	 	 	 	 	 d2d3 fd"Zed4d#            Z	e	j
        d5d%            Z	d6d)Zd7d*Zd8d,Zed9d.            Zd:d0Zed;d1            Z xZS )<ClassDefzClass definition)r   r   r   r  	type_varsbase_type_exprsremoved_base_type_exprsr9  	metaclassrX  keywordsanalyzedhas_incompatible_baseclassr  removed_statements)r   r   r   r   r   r  r   r  r  z list[mypy.types.TypeVarLikeType]r1  r  r2  r3  r   r9  r  r4  rX  zdict[str, Expression]r5  r6  r   r7  r   r8  N'list[mypy.types.TypeVarLikeType] | Nonelist[Expression] | None#list[tuple[str, Expression]] | Noner?   r@   c                N   t                                                       || _        d| _        || _        |pg | _        || _        |pg | _        g | _        t          | _
        || _        g | _        |rt          |          ni | _        d | _        d| _        d | _        g | _        d S Nr   F)r   rE   r   r   r   r1  r  r2  r3  CLASSDEF_NO_INFOr9  r4  rX  dictr5  r6  r7  r  r8  )	rC   r   r   r1  r2  r4  r5  r  r   s	           rD   rE   zClassDef.__init__|  s     			"b".4"')$$	"*2:X*/'%)"$rF   c                    | j         S rB   r   r   s    rD   r   zClassDef.fullname  r   rF   r)  c                    || _         d S rB   r   rC   r)  s     rD   r   zClassDef.fullname      rF   r   r   rU   c                ,    |                     |           S rB   )visit_class_defr   s     rD   r   zClassDef.accept  r   rF   c                4    | j                                         S rB   )r9  
is_genericr   s    rD   rG  zClassDef.is_generic  r  rF   rW   c                B    d| j         | j        d | j        D             dS )Nr0  c                6    g | ]}|                                 S rT   rg  rj   r)  s     rD   rh  z&ClassDef.serialize.<locals>.<listcomp>  s     @@@A!++--@@@rF   )r   r   r   r1  )r   r   r1  r   s    rD   r   zClassDef.serialize  s3     !I@@@@@	
 
 	
rF   r   c                    |d         dk    sJ t          |d         t          g           d |d         D                       }|d         |_        |S )Nr   r0  r   c                    g | ]>}t          t          j        j        t          j                            |                    ?S rT   )r   r   ro  TypeVarLikeTyperp  rJ  s     rD   rh  z(ClassDef.deserialize.<locals>.<listcomp>  sG        TZ/1L1LQ1O1OPP  rF   r1  r   )r0  r  r   r   r   rt  s      rD   r   zClassDef.deserialize  sj    H~++++L"II k*  	
 
 J'
rF   r   c                    t          |t                     t          || j                   t          j                            || j                   t          || j                   d S rB   )	r-   	CLASS_DEFr)   r   r   ro  write_type_listr1  r   r   s     rD   r   zClassDef.write  sV    $	"""$	"""
""4888$&&&&&rF   c           
         t          t                    t          g           fdt          t	                              D                       }t                    |_        |S )Nc                N    g | ]!}t           j                                      "S rT   r   ro  read_type_var_liker}  s     rD   rh  z!ClassDef.read.<locals>.<listcomp>  s)    PPPQTZ**400PPPrF   )r0  r   r  r  r   r   rN  s    ` rD   r   zClassDef.read  s]    TNN"IIPPPP%:O:OPPP
 

  ~~
rF   )NNNNN)r   r   r   r  r1  r9  r2  r:  r4  r  r5  r;  r  r  r?   r@   r   r)  r   r?   r@   r   r  r   )r   rW   r?   r0  r   )r   r   r?   r0  )rO   rP   rQ   rR   rS   r  rr   rE   r   r   ra  r   rG  r   r   r   r   r   r  r  s   @rD   r0  r0  Q  s        I$ &NIIINNNKKK%%%%////%%%%----NNN        ####$$$$'''' >B37'+8<,0% % % % % % %6    X _   _- - - -& & & &
 
 
 
    [' ' ' '    [    rF   r0  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   r?   r@   c                V    t                                                       || _        d S rB   r   rE   r   rC   r   r   s     rD   rE   zGlobalDecl.__init__  $    


rF   r   r   rU   c                ,    |                     |           S rB   )visit_global_declr   s     rD   r   zGlobalDecl.accept  r*  rF   r   rZ  r?   r@   r   r"  r  s   @rD   rX  rX    so         &&IN     / / / / / / / /rF   rX  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, ...rY  rZ  r   r?   r@   c                V    t                                                       || _        d S rB   r\  r]  s     rD   rE   zNonlocalDecl.__init__  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_nonlocal_declr   s     rD   r   zNonlocalDecl.accept      **4000rF   ra  r   r"  r  s   @rD   rc  rc    so         ((IN     1 1 1 1 1 1 1 1rF   rc  c                  6     e Zd ZdZdZddd fd
ZddZ xZS )r  )r  r  F)r  r  r   r  r   r?   r@   c               d    t                                                       || _        || _        d S rB   )r   rE   r  r  )rC   r  r  r   s      rD   rE   zBlock.__init__  s0    	 -rF   r   r   rU   c                ,    |                     |           S rB   )visit_blockr   s     rD   r   zBlock.accept   s    ""4(((rF   )r  r   r  r   r?   r@   r   )rO   rP   rQ   rS   r  rE   r   r  r  s   @rD   r  r    sh        *I/NHM - - - - - - - -) ) ) ) ) ) ) )rF   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 )ExpressionStmtz/An expression as a statement, such as print(s).exprr   ro  r?   r@   c                V    t                                                       || _        d S rB   r   rE   ro  rC   ro  r   s     rD   rE   zExpressionStmt.__init__  $    			rF   r   r   rU   c                ,    |                     |           S rB   )visit_expression_stmtr   s     rD   r   zExpressionStmt.accept      ,,T222rF   ro  r   r?   r@   r   r"  r  s   @rD   rm  rm    so         99IN     3 3 3 3 3 3 3 3rF   rm  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   r8  
new_syntaxis_alias_defis_final_definvalid_recursive_alias)rz  rvaluesr   list[Lvalue]rz  r   r{  r  r   r8  r   r|  r}  r~  r  NFr?   r@   c                    t                                                       || _        || _        || _        || _        || _        d| _        d| _        d| _	        d S r  )
r   rE   rz  r{  r   r8  r|  r}  r~  r  )rC   rz  r{  r   r|  r   s        rD   rE   zAssignmentStmt.__init__F  s]     		#$!!',$$$rF   r   r   rU   c                ,    |                     |           S rB   )visit_assignment_stmtr   s     rD   r   zAssignmentStmt.acceptW  rv  rF   r  )
rz  r  r{  r   r   r  r|  r   r?   r@   r   r"  r  s   @rD   ry  ry    s          	I 4N    ++++  "!!! (, - - - - - - -"3 3 3 3 3 3 3 3rF   ry  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{  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   )r   rE   r  r  r{  )rC   r  r  r{  r   s       rD   rE   zOperatorAssignmentStmt.__init__f  s2    rF   r   r   rU   c                ,    |                     |           S rB   )visit_operator_assignment_stmtr   s     rD   r   zOperatorAssignmentStmt.acceptl      55d;;;rF   )r  r   r  r   r{  r   r?   r@   r   r"  r  s   @rD   r  r  [  s         66*I/NGGGNNN     < < < < < < < <rF   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ro  r  	else_bodyr   ro  r  r  r  r  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   r   rE   ro  r  r  rC   ro  r  r  r   s       rD   rE   zWhileStmt.__init__y  2    		"rF   r   r   rU   c                ,    |                     |           S rB   )visit_while_stmtr   s     rD   r   zWhileStmt.accept  r0  rF   )ro  r   r  r  r  r  r?   r@   r   	rO   rP   rQ   rS   r  rr   rE   r   r  r  s   @rD   r  r  p  s~         -I2NKKK# # # # # #. . . . . . . .rF   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_typero  r  r  is_async)r  r  ro  r  r  r   r  r  r  r  r  r  r   ro  r  r  r  r  r   r  Nr?   r@   c                    t                                                       || _        || _        || _        d | _        d | _        || _        || _        || _	        d| _
        d S r  )r   rE   r  r  r  r  r  ro  r  r  r  )rC   r  ro  r  r  r  r   s         rD   rE   zForStmt.__init__  sa     	
$%/""&&*#		"rF   r   r   rU   c                ,    |                     |           S rB   )visit_for_stmtr   s     rD   r   zForStmt.accept  r  rF   rB   )r  r   ro  r   r  r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r    s         
I JN MMM&&&&1111....2222KKKNNN .2      &, , , , , , , ,rF   r  c                  <     e Zd ZU dZdZded<   d fdZdd
Z xZS )
ReturnStmtrn  r  ro  r?   r@   c                V    t                                                       || _        d S rB   rq  rr  s     rD   rE   zReturnStmt.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_return_stmtr   s     rD   r   zReturnStmt.accept  r*  rF   ro  r  r?   r@   r   r  r  s   @rD   r  r    si         IN     / / / / / / / /rF   r  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)ro  msgr   ro  r  r  Nr?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   ro  r  )rC   ro  r  r   s      rD   rE   zAssertStmt.__init__  s+    	rF   r   r   rU   c                ,    |                     |           S rB   )visit_assert_stmtr   s     rD   r   zAssertStmt.accept  r*  rF   rB   )ro  r   r  r  r?   r@   r   r  r  s   @rD   r  r    sz         I$N      
/ / / / / / / /rF   r  c                  <     e Zd ZU dZdZded<   d fdZdd
Z xZS )DelStmtrn  r   ro  r?   r@   c                V    t                                                       || _        d S rB   rq  rr  s     rD   rE   zDelStmt.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_del_stmtr   s     rD   r   zDelStmt.accept  r  rF   )ro  r   r?   r@   r   r  r  s   @rD   r  r    sf         INLLL     , , , , , , , ,rF   r  c                      e Zd ZdZddZdS )		BreakStmtrT   r   r   r?   rU   c                ,    |                     |           S rB   )visit_break_stmtr   s     rD   r   zBreakStmt.accept  r0  rF   Nr   rO   rP   rQ   rS   r   rT   rF   rD   r  r    s-        I. . . . . .rF   r  c                      e Zd ZdZddZdS )	ContinueStmtrT   r   r   r?   rU   c                ,    |                     |           S rB   )visit_continue_stmtr   s     rD   r   zContinueStmt.accept  rg  rF   Nr   r  rT   rF   rD   r  r    s-        I1 1 1 1 1 1rF   r  c                      e Zd ZdZddZdS )	PassStmtrT   r   r   r?   rU   c                ,    |                     |           S rB   )visit_pass_stmtr   s     rD   r   zPassStmt.accept  r   rF   Nr   r  rT   rF   rD   r  r    s-        I- - - - - -rF   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 )IfStmtr  r  ro  list[Block]r  r  r  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   r  r  s       rD   rE   zIfStmt.__init__  r  rF   r   r   rU   c                ,    |                     |           S rB   )visit_if_stmtr   s     rD   r   zIfStmt.accept      $$T***rF   )ro  r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r    s         -I2N# # # # # #+ + + + + + + +rF   r  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)ro  	from_exprr  ro  r  r?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   ro  r  )rC   ro  r  r   s      rD   rE   zRaiseStmt.__init__  s+    	"rF   r   r   rU   c                ,    |                     |           S rB   )visit_raise_stmtr   s     rD   r   zRaiseStmt.accept  r0  rF   )ro  r  r  r  r?   r@   r   r  r  s   @rD   r  r    sw         %I*N     # # # # # #
. . . . . . . .rF   r  c                  x     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)r  ro  varshandlersr  finally_bodyis_starr  r  list[Expression | None]ro  list[NameExpr | None]r  r  r  r  r  r  r   r  r?   r@   c                    t                                                       || _        || _        || _        || _        || _        || _        d| _        d S r  )	r   rE   r  r  ro  r  r  r  r  )rC   r  r  ro  r  r  r  r   s          rD   rE   zTryStmt.__init__1  sQ     			
 "(rF   r   r   rU   c                ,    |                     |           S rB   )visit_try_stmtr   s     rD   r   zTryStmt.acceptC  r  rF   )r  r  r  r  ro  r  r  r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r  "  s         ]IbNKKK""""MMM     $, , , , , , , ,rF   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ed<   ded<   	 dd fdZddZ xZS )WithStmt)ro  rG   r8  analyzed_typesr  r  )ro  rG   r  r  ro  list[Lvalue | None]rG   r  r8  r  r  r  r  r   r  Ntarget_typer?   r@   c                    t                                                       || _        || _        || _        g | _        || _        d| _        d S r  )r   rE   ro  rG   r8  r  r  r  )rC   ro  rG   r  r  r   s        rD   rE   zWithStmt.__init__U  sK     		* 	rF   r   r   rU   c                ,    |                     |           S rB   )visit_with_stmtr   s     rD   r   zWithStmt.acceptd  r   rF   rB   )
ro  r  rG   r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r  G  s         [I/N++++))))KKKNNN /3      - - - - - - - -rF   r  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 )	MatchStmt)subjectsubject_dummypatternsguardsbodies)r  r  r  r  r   r  zNameExpr | Noner  list[Pattern]r  r  r  r  r  r?   r@   c                    t                                                       t          |          t          |          cxk    rt          |          k    sn J || _        d | _        || _        || _        || _        d S rB   )r   rE   r   r  r  r  r  r  )rC   r  r  r  r  r   s        rD   rE   zMatchStmt.__init__s  sz     	8}}F::::s6{{::::::! rF   r   r   rU   c                ,    |                     |           S rB   )visit_match_stmtr   s     rD   r   zMatchStmt.accept  r0  rF   )
r  r   r  r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r  h  s         LI@N""""####     . . . . . . . .rF   r  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)r   r  r  r  
alias_node)r   r  r  NameExprr   list[TypeParam]r  
LambdaExprr  r   r  TypeAlias | Noner  r?   r@   c                    t                                                       || _        || _        || _        d| _        d | _        d S r  )r   rE   r   r  r  r  r  )rC   r   r  r  r   s       rD   rE   zTypeAliasStmt.__init__  sA    	"
',$rF   r   r   rU   c                ,    |                     |           S rB   )visit_type_alias_stmtr   s     rD   r   zTypeAliasStmt.accept  rv  rF   )r   r  r  r  r  r  r?   r@   r   r  r  s   @rD   r  r    s         WI3NNNN!!!!         3 3 3 3 3 3 3 3rF   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  r?   r@   c                V    t                                                       || _        d S rB   r   rE   r  rC   r  r   s     rD   rE   zIntExpr.__init__  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_int_exprr   s     rD   r   zIntExpr.accept  r  rF   )r  r>   r?   r@   r   r"  r  s   @rD   r  r    sl         INJJJ     , , , , , , , ,rF   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  r?   r@   c                V    t                                                       || _        d S rB   r  r  s     rD   rE   zStrExpr.__init__  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_str_exprr   s     rD   r   zStrExpr.accept  r  rF   r  r   r?   r@   r   r"  r  s   @rD   r  r    sl         INJJJ     , , , , , , , ,rF   r  seqr  r?   TypeGuard[list[StrExpr]]c                4    t          d | D                       S )Nc              3  @   K   | ]}t          |t                    V  d S rB   )rK   r  r  s     rD   r  z"is_StrExpr_list.<locals>.<genexpr>  s,      99Tz$((999999rF   )r  )r  s    rD   is_StrExpr_listr    s    99S999999rF   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  r?   r@   c                V    t                                                       || _        d S rB   r  r  s     rD   rE   zBytesExpr.__init__  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_bytes_exprr   s     rD   r   zBytesExpr.accept  r0  rF   r  r   r"  r  s   @rD   r
  r
    sn         IN JJJ     . . . . . . . .rF   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  r?   r@   c                V    t                                                       || _        d S rB   r  r  s     rD   rE   zFloatExpr.__init__  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_float_exprr   s     rD   r   zFloatExpr.accept  r0  rF   )r  r  r?   r@   r   r"  r  s   @rD   r  r    sl         INLLL     . . . . . . . .rF   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  r-  r  r?   r@   c                V    t                                                       || _        d S rB   r  r  s     rD   rE   zComplexExpr.__init__   r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_complex_exprr   s     rD   r   zComplexExpr.accept      ))$///rF   )r  r-  r?   r@   r   r"  r  s   @rD   r  r    sl         INNNN     0 0 0 0 0 0 0 0rF   r  c                      e Zd ZdZdZd	dZdS )
EllipsisExprzEllipsis (...)rT   r   r   r?   rU   c                ,    |                     |           S rB   )visit_ellipsisr   s     rD   r   zEllipsisExpr.accept  r  rF   Nr   r   rT   rF   rD   r  r    s3        I, , , , , ,rF   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)ro  validr   ro  r   r   r?   r@   c                d    t                                                       || _        d| _        d S r  )r   rE   ro  r   rr  s     rD   rE   zStarExpr.__init__  s-    	 


rF   r   r   rU   c                ,    |                     |           S rB   )visit_star_exprr   s     rD   r   zStarExpr.accept"  r   rF   rw  r   r"  r  s   @rD   r  r    sx         !I&NKKK     - - - - - - - -rF   r  c                  b     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)r  noder   
is_new_defis_inferred_defis_alias_rvalue
type_guardtype_isr?   r@   c                    t                                                       d | _        d | _        d| _        d| _        d| _        d| _        d | _        d | _	        d S r=  )
r   rE   r  r&  r   r'  r(  r)  r*  r+  r  s    rD   rE   zRefExpr.__init__4  sY     $	'+	
  %$26/3rF   r   c                    | j         S rB   r   r   s    rD   r   zRefExpr.fullnameJ  r   rF   r)  c                    || _         d S rB   r   rB  s     rD   r   zRefExpr.fullnameN  rC  rF   r  r   rV  )
rO   rP   rQ   rR   rS   rE   r   r   ra  r  r  s   @rD   r%  r%  &  s        66	I4 4 4 4 4 4,    X _   _    rF   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.
    )r   is_special_form)r   r&  r   r   r?   r@   c                d    t                                                       || _        d| _        d S r  )r   rE   r   r0  )rC   r   r   s     rD   rE   zNameExpr.__init__]  s.    	$rF   r   r   rU   c                ,    |                     |           S rB   )visit_name_exprr   s     rD   r   zNameExpr.acceptc  r   rF   rW   c                    J d|              )NFzSerializing NameExpr: rT   r   s    rD   r   zNameExpr.serializef  s    55t55555rF   )r   r   r?   r@   r   r   )
rO   rP   rQ   rR   rS   r  rE   r   r   r  r  s   @rD   r  r  S  s{         
 ,I%N% % % % % %- - - -6 6 6 6 6 6 6 6rF   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)ro  r   def_var)ro  r   r&  ro  r   r   r   r?   r@   c                r    t                                                       || _        || _        d | _        d S rB   )r   rE   ro  r   r7  )rC   ro  r   r   s      rD   rE   zMemberExpr.__init__q  s4    		 $(rF   r   r   rU   c                ,    |                     |           S rB   )visit_member_exprr   s     rD   r   zMemberExpr.accepty  r*  rF   )ro  r   r   r   r?   r@   r   	rO   rP   rQ   rR   rS   r  rE   r   r  r  s   @rD   r6  r6  j  sa        &&+I-N( ( ( ( ( (/ / / / / / / /rF   r6  c                  R    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dS )r  r   rY   r[   r]         Fstarr   r?   c                H    | t           k    p| t          k    p|o
| t          k    S rB   )r  r  ARG_STARrC   r?  s     rD   is_positionalzArgKind.is_positional  s$    wP$'/Pd6Otx?OPrF   c                H    | t           k    p| t          k    p|o
| t          k    S rB   )	ARG_NAMEDARG_NAMED_OPT	ARG_STAR2rB  s     rD   is_namedzArgKind.is_named  s&    y YDM$9Yd>XtyGXYrF   c                .    | t           k    p
| t          k    S rB   )r  rE  r   s    rD   is_requiredzArgKind.is_required  s    w3$)"33rF   c                .    | t           k    p
| t          k    S rB   )r  rF  r   s    rD   is_optionalzArgKind.is_optional  s    w7$-"77rF   c                .    | t           k    p
| t          k    S rB   )rA  rG  r   s    rD   r  zArgKind.is_star  s    x449#44rF   Nr  )r?  r   r?   r   r  )rO   rP   rQ   r  r  rA  rE  rG  rF  rC  rH  rJ  rL  r  rT   rF   rD   r  r  ~  s         GGHIIMQ Q Q Q QZ Z Z Z Z4 4 4 48 8 8 85 5 5 5 5 5rF   r  r  r  rA  rE  rG  rF  r  c                  8     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argsr  r  r6  )rP  rQ  r  r  NrP  r   rQ  r  r  list[ArgKind]r  list[str | None]r6  r  r?   r@   c                    t                                                       |sd gt          |          z  }|| _        || _        || _        || _        || _        d S rB   )r   rE   r   rP  rQ  r  r  r6  )rC   rP  rQ  r  r  r6  r   s         rD   rE   zCallExpr.__init__  s^     	 	+T*I	"+4 !rF   r   r   rU   c                ,    |                     |           S rB   )visit_call_exprr   s     rD   r   zCallExpr.accept  r   rF   rB   )rP  r   rQ  r  r  rR  r  rS  r6  r  r?   r@   r   r;  r  s   @rD   rO  rO    sr          IIAN '+! ! ! ! ! ! !*- - - - - - - -rF   rO  c                  <     e Zd ZU dZdZded<   d fdZdd
Z xZS )YieldFromExprrn  r   ro  r?   r@   c                V    t                                                       || _        d S rB   rq  rr  s     rD   rE   zYieldFromExpr.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_yield_from_exprr   s     rD   r   zYieldFromExpr.accept  rv  rF   rw  r   r  r  s   @rD   rX  rX    si         IN     3 3 3 3 3 3 3 3rF   rX  c                  <     e Zd ZU dZdZded<   d fdZdd
Z xZS )	YieldExprrn  r  ro  r?   r@   c                V    t                                                       || _        d S rB   rq  rr  s     rD   rE   zYieldExpr.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_yield_exprr   s     rD   r   zYieldExpr.accept  r0  rF   r  r   r  r  s   @rD   r]  r]    si         IN     . . . . . . . .rF   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_typer6  )rc  r  r   rc  r  r  rd  z&TypeApplication | TypeAliasExpr | Noner6  r?   r@   c                    t                                                       || _        || _        d | _        d | _        d S rB   )r   rE   rc  r  rd  r6  )rC   rc  r  r   s      rD   rE   zIndexExpr.__init__  s:    	
rF   r   r   rU   c                ,    |                     |           S rB   )visit_index_exprr   s     rD   r   zIndexExpr.accept	  r0  rF   )rc  r   r  r   r?   r@   r   r"  r  s   @rD   rb  rb    s          
 =I&N'''' 5444     . . . . . . . .rF   rb  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  ro  rd  )r  ro  r   r  r   ro  r  rd  r?   r@   c                r    t                                                       || _        || _        d | _        d S rB   )r   rE   r  ro  rd  )rC   r  ro  r   s      rD   rE   zUnaryExpr.__init__	  s5    	rF   r   r   rU   c                ,    |                     |           S rB   )visit_unary_exprr   s     rD   r   zUnaryExpr.accept	  r0  rF   )r  r   ro  r   r?   r@   r   r"  r  s   @rD   ri  ri  	  s         -I#NGGG''''           . . . . . . . .rF   ri  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".)rG   r  rG   r  r  r   r?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   rG   r  )rC   rG   r  r   s      rD   rE   zAssignmentExpr.__init__#	  s+    


rF   r   r   rU   c                ,    |                     |           S rB   )visit_assignment_exprr   s     rD   r   zAssignmentExpr.accept(	  rv  rF   )rG   r  r  r   r?   r@   r   r;  r  s   @rD   rn  rn  	  sa        ??#I(N     
3 3 3 3 3 3 3 3rF   rn  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rightrd  right_alwaysright_unreachabler6  )rt  r  ru  r   r  r   rt  ru  r  rd  r   rv  rw  TypeAliasExpr | Noner6  Nr?   r@   c                    t                                                       || _        || _        || _        d | _        d| _        d| _        || _        d S r  )	r   rE   r  rt  ru  rd  rv  rw  r6  )rC   r  rt  ru  r6  r   s        rD   rE   zOpExpr.__init__J	  sS     		
!!& rF   r   r   rU   c                ,    |                     |           S rB   )visit_op_exprr   s     rD   r   zOpExpr.acceptV	  r  rF   rB   )
r  r   rt  r   ru  r   r6  rx  r?   r@   r   r"  r  s   @rD   rs  rs  ,	  s          
I -NGGG''''"""" ^b
! 
! 
! 
! 
! 
! 
!+ + + + + + + +rF   rs  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~  rZ  r~  r  r  zlist[mypy.types.Type | None]r  r?   r@   c                r    t                                                       || _        || _        g | _        d S rB   )r   rE   r~  r  r  )rC   r~  r  r   s      rD   rE   zComparisonExpr.__init__f	  s5    " rF   ,Iterator[tuple[str, Expression, Expression]]c              #  ~   K   t          | j                  D ]%\  }}|| j        |         | j        |dz            fV  &dS )zzIf this comparison expr is "a < b is c == d", yields the sequence
        ("<", a, b), ("is", b, c), ("==", c, d)
        rY   N)rV  r~  r  )rC   rZ  operators      rD   pairwisezComparisonExpr.pairwisel	  s[       %T^44 	C 	CKAxDM!,dmAE.BBBBBB	C 	CrF   r   r   rU   c                ,    |                     |           S rB   )visit_comparison_exprr   s     rD   r   zComparisonExpr.accepts	  rv  rF   )r~  rZ  r  r  r?   r@   )r?   r  r   )rO   rP   rQ   rR   rS   r  rr   rE   r  r   r  r  s   @rD   r}  r}  Z	  s         559I.N....     C C C C3 3 3 3 3 3 3 3rF   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 )	SliceExprznSlice expression (e.g. 'x:y', 'x:', '::2' or ':').

    This is only valid as index in index expressions.
    )begin_index	end_indexstrider  r  r  r  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   )r   rE   r  r  r  )rC   r  r  r  r   s       rD   rE   zSliceExpr.__init__	  s5     	&"rF   r   r   rU   c                ,    |                     |           S rB   )visit_slice_exprr   s     rD   r   zSliceExpr.accept	  r0  rF   )r  r  r  r  r  r  r?   r@   r   r"  r  s   @rD   r  r  w	  s          
 7I;N""""    	 	 	 	 	 	. . . . . . . .rF   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).ro  r   r   ro  mypy.types.Typer   ru  r?   r@   c                d    t                                                       || _        || _        d S rB   r   rE   ro  r   rC   ro  ru  r   s      rD   rE   zCastExpr.__init__	  +    				rF   r   r   rU   c                ,    |                     |           S rB   )visit_cast_exprr   s     rD   r   zCastExpr.accept	  r   rF   ro  r   ru  r  r?   r@   r   r"  r  s   @rD   r  r  	  s{         ++ I%N     
- - - - - - - -rF   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   ro  r  r   ru  r?   r@   c                d    t                                                       || _        || _        d S rB   r  r  s      rD   rE   zAssertTypeExpr.__init__	  r  rF   r   r   rU   c                ,    |                     |           S rB   )visit_assert_type_exprr   s     rD   r   zAssertTypeExpr.accept	      --d333rF   r  r   r"  r  s   @rD   r  r  	  s{         ;; I%N     
4 4 4 4 4 4 4 4rF   r  c                  \     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.)ro  r  local_nodesis_importedr  ro  r>   r  list[Var] | Noner  NFr  r   r?   r@   c                    t                                                       || _        || _        || _        || _        d S rB   )r   rE   ro  r  r  r  )rC   r  ro  r  r  r   s        rD   rE   zRevealExpr.__init__	  s?     			&&rF   r   r   rU   c                ,    |                     |           S rB   )visit_reveal_exprr   s     rD   r   zRevealExpr.accept	  r*  rF   )NNF)
r  r>   ro  r  r  r  r  r   r?   r@   r   r"  r  s   @rD   r  r  	  s         QQ>ICNIII!!!!
 #'(,!' ' ' ' ' ' '/ / / / / / / /rF   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 )	SuperExprzExpression super().name)r   r9  call)r   r  r9  r   r   TypeInfo | Noner9  rO  r  r?   r@   c                r    t                                                       || _        || _        d | _        d S rB   )r   rE   r   r  r9  )rC   r   r  r   s      rD   rE   zSuperExpr.__init__	  s2    					rF   r   r   rU   c                ,    |                     |           S rB   )visit_super_exprr   s     rD   r   zSuperExpr.accept	  r0  rF   )r   r   r  rO  r?   r@   r   r"  r  s   @rD   r  r  	  s         !!(I-NIIINNN     . . . . . . . .rF   r  c                  F    e Zd ZdZdZedd            ZddZddZddZ	dS )r  zLambda expression)r  r  r  r  r?   r   c                    t           S rB   )r   r   s    rD   r   zLambdaExpr.name	  s    rF   r   c                n    | j         j         d         }t          |t                    sJ |j        }|J |S )z/Return the expression (the body) of the lambda.r=   )r  rK   r  ro  )rC   r  ro  s      rD   ro  zLambdaExpr.expr	  s>    inR #z*****xrF   r   r   rU   c                ,    |                     |           S rB   )visit_lambda_exprr   s     rD   r   zLambdaExpr.accept	  r*  rF   r   c                    dS r  rT   r   s    rD   r  zLambdaExpr.is_dynamic	  s    urF   Nr   )r?   r   r   r  )
rO   rP   rQ   rR   r  r   r   ro  r   r  rT   rF   rD   r  r  	  sy        DN   X   / / / /     rF   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 [...].rH  r  rH  r?   r@   c                V    t                                                       || _        d S rB   r   rE   rH  rS  s     rD   rE   zListExpr.__init__
  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_list_exprr   s     rD   r   zListExpr.accept
  r   rF   rH  r  r?   r@   r   r"  r  s   @rD   r  r  
  so         ((IN     - - - - - - - -rF   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 )DictExprz0Dictionary literal expression {key: value, ...}.r  *list[tuple[Expression | None, Expression]]rH  r?   r@   c                V    t                                                       || _        d S rB   r  rS  s     rD   rE   zDictExpr.__init__
  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_dict_exprr   s     rD   r   zDictExpr.accept!
  r   rF   )rH  r  r?   r@   r   r"  r  s   @rD   r  r  
  so         ::IN5555     - - - - - - - -rF   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 )	TupleExprzXTuple literal expression (..., ...)

    Also lvalue sequences (..., ...) and [..., ...]r  r  rH  r?   r@   c                V    t                                                       || _        d S rB   r  rS  s     rD   rE   zTupleExpr.__init__0
  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_tuple_exprr   s     rD   r   zTupleExpr.accept4
  r0  rF   r  r   r"  r  s   @rD   r  r  %
  su         7 7 IN     . . . . . . . .rF   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 )SetExprz$Set literal expression {value, ...}.r  r  rH  r?   r@   c                V    t                                                       || _        d S rB   r  rS  s     rD   rE   zSetExpr.__init__A
  r^  rF   r   r   rU   c                ,    |                     |           S rB   )visit_set_exprr   s     rD   r   zSetExpr.acceptE
  r  rF   r  r   r"  r  s   @rD   r  r  8
  so         ..IN     , , , , , , , ,rF   r  c                  h     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	condlistsr  indices)r  r  r  r  r   r  r  r  list[list[Expression]]r  
list[bool]r  r  r  r?   r@   c                    t                                                       || _        || _        || _        || _        || _        d S rB   )r   rE   r  r  r  r  r  )rC   r  r  r  r  r  r   s         rD   rE   zGeneratorExpr.__init__V
  sB     	""" rF   r   r   rU   c                ,    |                     |           S rB   )visit_generator_exprr   s     rD   r   zGeneratorExpr.accepte
      ++D111rF   )r  r   r  r  r  r  r  r  r  r  r?   r@   r   r"  r  s   @rD   r  r  I
  s         QQNIGN%%%%! ! ! ! ! !2 2 2 2 2 2 2 2rF   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  r  r?   r@   c                V    t                                                       || _        d S rB   r   rE   r  rC   r  r   s     rD   rE   zListComprehension.__init__r
  $    "rF   r   r   rU   c                ,    |                     |           S rB   )visit_list_comprehensionr   s     rD   r   zListComprehension.acceptv
  s    //555rF   r  r  r?   r@   r   r"  r  s   @rD   r  r  i
  so         66I#N# # # # # #6 6 6 6 6 6 6 6rF   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 )SetComprehensionz+Set comprehension (e.g. {x + 1 for x in a})r  r  r  r?   r@   c                V    t                                                       || _        d S rB   r  r  s     rD   rE   zSetComprehension.__init__
  r  rF   r   r   rU   c                ,    |                     |           S rB   )visit_set_comprehensionr   s     rD   r   zSetComprehension.accept
  s    ..t444rF   r  r   r"  r  s   @rD   r  r  z
  so         55I#N# # # # # #5 5 5 5 5 5 5 5rF   r  c                  r     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  r  r  r  )r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r?   r@   c                    t                                                       || _        || _        || _        || _        || _        || _        d S rB   )r   rE   r  r  r  r  r  r  )rC   r  r  r  r  r  r  r   s          rD   rE   z DictionaryComprehension.__init__
  sI     	
"" rF   r   r   rU   c                ,    |                     |           S rB   )visit_dictionary_comprehensionr   s     rD   r   zDictionaryComprehension.accept
  r  rF   )r  r   r  r   r  r  r  r  r  r  r  r  r?   r@   r   r"  r  s   @rD   r  r  
  s         ==QIJNOOO%%%%! ! ! ! ! !"< < < < < < < <rF   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 )ConditionalExprz+Conditional expression (e.g. x if y else z))condif_expr	else_expr)r  r  r  r   r  r  r  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   )r   rE   r  r  r  )rC   r  r  r  r   s       rD   rE   zConditionalExpr.__init__
  s2    	"rF   r   r   rU   c                ,    |                     |           S rB   )visit_conditional_exprr   s     rD   r   zConditionalExpr.accept
  r  rF   )r  r   r  r   r  r   r?   r@   r   r"  r  s   @rD   r  r  
  s         550I5N# # # # # #4 4 4 4 4 4 4 4rF   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, ...])ro  ro  r   ro  r  ro  r?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   ro  ro  )rC   ro  ro  r   s      rD   rE   zTypeApplication.__init__
  s+    	


rF   r   r   rU   c                ,    |                     |           S rB   )visit_type_applicationr   s     rD   r   zTypeApplication.accept
  r  rF   )ro  r   ro  r  r?   r@   r   r"  r  s   @rD   r  r  
  s{         **!I&N         
4 4 4 4 4 4 4 4rF   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.
    )rk   r   r  r  varianceis_new_styler   rk   r   r  r  r  r>   r  Fr=   r   r   r  r   r9   r?   r@   c                    t                                          |           || _        || _        || _        || _        || _        || _        d S N)r9   )r   rE   rk   r   r  r  r  r  )	rC   r   r   r  r  r  r  r9   r   s	           rD   rE   zTypeVarLikeExpr.__init__
  sR     	d###
!& (rF   c                    | j         S rB   r  r   s    rD   r   zTypeVarLikeExpr.name  r  rF   c                    | j         S rB   r   r   s    rD   r   zTypeVarLikeExpr.fullname  r   rF   )r   r   r   r   r  r  r  r  r  r>   r  r   r9   r>   r?   r@   r   )rO   rP   rQ   rR   rS   rr   r  rE   r   r   r   r  r  s   @rD   r  r  
  s          
 ]IJJJNNN !    
 MMM "") ) ) ) ) ) )$    X    X    rF   r  SYMBOL_NODE_EXPRESSION_TYPESc                       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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.
    )r  )r   r  r  r  r  r  Fr=   r   r   r   r  r  r  r  r>   r  r   r9   r?   r@   c	           	     f    t                                          |||||||           || _        d S r  )r   rE   r  )
rC   r   r   r  r  r  r  r  r9   r   s
            rD   rE   zTypeVarExpr.__init__/  s8     	xgx\`aaarF   r   r   rU   c                ,    |                     |           S rB   )visit_type_var_exprr   s     rD   r   zTypeVarExpr.accept=  rg  rF   rW   c                    d| j         | j        d | j        D             | j                                        | j                                        | j        dS )Nr  c                6    g | ]}|                                 S rT   rg  rj   ts     rD   rh  z)TypeVarExpr.serialize.<locals>.<listcomp>E  s     :::q{{}}:::rF   )r   r   r   r  r  r  r  )rk   r   r  r  r   r  r  r   s    rD   r   zTypeVarExpr.serialize@  sY    #J::dk:::+5577|--//
 
 	
rF   r   c           
        |d         dk    sJ t          |d         |d         d |d         D             t          j                            |d                   t          j                            |d                   |d	                   S )
Nr   r  r   r   c                L    g | ]!}t           j                            |          "S rT   r   ro  rp  rJ  s     rD   rh  z+TypeVarExpr.deserialize.<locals>.<listcomp>Q  s(    DDDTZ((++DDDrF   r  r  r  r  )r  r   ro  rp  r   s     rD   r   zTypeVarExpr.deserializeK  s    H~....LDDT(^DDDJ''](;<<J''Y88
 
 	
rF   r   c                `   t          |t                     t          || j                   t          || j                   t
          j                            || j                   | j	        
                    |           | j        
                    |           t          || j                   d S rB   )r-   TYPE_VAR_EXPRr)   rk   r   r   ro  rQ  r  r  r   r  r%   r  r   s     rD   r   zTypeVarExpr.writeW  s    $&&&$
###$'''
""4555t$$$4   $&&&&&rF   c           
     &   t          t          |          t          |          t          j                            |          t          j                            |          t          j                            |          t          |                    S rB   )r  r   r   ro  read_type_list	read_typer   r   s     rD   r   zTypeVarExpr.read`  sh    TNNTNNJ%%d++J  &&J  &&TNN
 
 	
rF   )r   r   r   r   r  r  r  r  r  r  r  r>   r  r   r9   r>   r?   r@   r   r   )r   rW   r?   r  r   )r   r   r?   r  )rO   rP   rQ   rR   rS   r  rr   r  rE   r   r   r   r   r   r   r  r  s   @rD   r  r    s         	 	 IAN "!!! ""      1 1 1 1	
 	
 	
 	
 	
 	
 	
 [	
' ' ' ' 
 
 
 [
 
 
 
 
rF   r  c                  ^    e Zd ZdZdZddZdd	Zedd            ZddZ	edd            Z
dS )ParamSpecExprrT   r   r  r  r   r   r?   rU   c                ,    |                     |           S rB   )visit_paramspec_exprr   s     rD   r   zParamSpecExpr.acceptq  r  rF   rW   c                    d| j         | j        | j                                        | j                                        | j        dS )Nr  )r   r   r   r  r  r  )rk   r   r  r   r  r  r   s    rD   r   zParamSpecExpr.serializet  sF    %J+5577|--//
 
 	
rF   r   c           	         |d         dk    sJ t          |d         |d         t          j                            |d                   t          j                            |d                   |d                   S )Nr   r  r   r   r  r  r  )r  r   ro  rp  r   s     rD   r   zParamSpecExpr.deserialize~  so    H~0000LJ''](;<<J''Y88
 
 	
rF   r   r@   c                   t          |t                     t          || j                   t          || j                   | j                            |           | j                            |           t          || j	                   d S rB   )
r-   PARAM_SPEC_EXPRr)   rk   r   r  r   r  r%   r  r   s     rD   r   zParamSpecExpr.write  s{    $((($
###$'''t$$$4   $&&&&&rF   c           	         t          t          |          t          |          t          j                            |          t          j                            |          t          |                    S rB   )r  r   r   ro  r  r   r   s     rD   r   zParamSpecExpr.read  sU    TNNTNNJ  &&J  &&TNN
 
 	
rF   Nr   r   )r   rW   r?   r  r   )r   r   r?   r  )rO   rP   rQ   rS   r  r   r   r   r   r   r   rT   rF   rD   r  r  l  s        I7N2 2 2 2
 
 
 
 
 
 
 [
' ' ' ' 
 
 
 [
 
 
rF   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d$dZed%d            Z xZS )&TypeVarTupleExprz1Type variable tuple expression TypeVarTuple(...).tuple_fallbackmypy.types.Instancer  Fr=   r   r   r   r  r  r  r  r>   r  r   r9   r?   r@   c	           	     f    t                                          |||||||           || _        d S r  )r   rE   r'  )
rC   r   r   r  r'  r  r  r  r9   r   s
            rD   rE   zTypeVarTupleExpr.__init__  s;     	xgx\`aaa,rF   r   r   rU   c                ,    |                     |           S rB   )visit_type_var_tuple_exprr   s     rD   r   zTypeVarTupleExpr.accept  rd  rF   rW   c                    d| j         | j        | j                                        | j                                        | j                                        | j        dS )Nr&  )r   r   r   r  r'  r  r  )rk   r   r  r   r'  r  r  r   s    rD   r   zTypeVarTupleExpr.serialize  sX    (J+5577"1;;==|--//
 
 	
rF   r   c           
     F   |d         dk    sJ t          |d         |d         t          j                            |d                   t          j        j                            |d                   t          j                            |d                   |d                   S )	Nr   r&  r   r   r  r'  r  r  )r&  r   ro  rp  Instancer   r   s     rD   r   zTypeVarTupleExpr.deserialize  s    H~!33333LJ''](;<<J++D1A,BCCJ''Y88
 
 	
rF   r   c                J   t          |t                     | j                            |           t	          || j                   t	          || j                   | j                            |           | j                            |           t          || j
                   d S rB   )r-   TYPE_VAR_TUPLE_EXPRr'  r   r)   rk   r   r  r  r%   r  r   s     rD   r   zTypeVarTupleExpr.write  s    $+,,,!!$'''$
###$'''t$$$4   $&&&&&rF   c           
     |   t          |          t          j        j        k    sJ t          j        j                            |          }t          t          |          t          |          t          j                            |          |t          j                            |          t          |                    S rB   )
r#   r   ro  INSTANCEr.  r   r&  r   r  r   )r   r   fallbacks      rD   r   zTypeVarTupleExpr.read  s    ~~!44444:&++D11TNNTNNJ  &&J  &&TNN
 
 	
rF   )r   r   r   r   r  r  r'  r(  r  r  r  r>   r  r   r9   r>   r?   r@   r   r   )r   rW   r?   r&  r   )r   r   r?   r&  )rO   rP   rQ   rR   rS   rr   r  r  rE   r   r   r   r   r   r   r  r  s   @rD   r&  r&    s         ;; I''''7N ""- - - - - - -7 7 7 7	
 	
 	
 	
 	
 	
 	
 [	
' ' ' ' 

 

 

 [

 

 

 

 

rF   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&  r?   r@   c                V    t                                                       || _        d S rB   )r   rE   r&  )rC   r&  r   s     rD   rE   zTypeAliasExpr.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_type_alias_exprr   s     rD   r   zTypeAliasExpr.accept  rv  rF   )r&  r   r?   r@   r   r"  r  s   @rD   r5  r5    sl         ))INOOO     3 3 3 3 3 3 3 3rF   r5  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(...).)r9  is_typedr9  r   r9  r   r<  Fr?   r@   c                d    t                                                       || _        || _        d S rB   )r   rE   r9  r<  )rC   r9  r<  r   s      rD   rE   zNamedTupleExpr.__init__  s+    	 rF   r   r   rU   c                ,    |                     |           S rB   )visit_namedtuple_exprr   s     rD   r   zNamedTupleExpr.accept  rv  rF   r  )r9  r   r<  r   r?   r@   r   r"  r  s   @rD   r;  r;    s|         DD$IN NNNNNN! ! ! ! ! ! !
3 3 3 3 3 3 3 3rF   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   r9  r?   r@   c                V    t                                                       || _        d S rB   )r   rE   r9  )rC   r9  r   s     rD   rE   zTypedDictExpr.__init__  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_typeddict_exprr   s     rD   r   zTypedDictExpr.accept  r  rF   )r9  r   r?   r@   r   r"  r  s   @rD   rB  rB  
  sn         //IN NNN     2 2 2 2 2 2 2 2rF   rB  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 ...').)r9  rH  r  r   r9  rZ  rH  r  r  r?   r@   c                r    t                                                       || _        || _        || _        d S rB   )r   rE   r9  rH  r  )rC   r9  rH  r  r   s       rD   rE   zEnumCallExpr.__init__)  s2    	
rF   r   r   rU   c                ,    |                     |           S rB   )visit_enum_call_exprr   s     rD   r   zEnumCallExpr.accept/  r  rF   )r9  r   rH  rZ  r  r  r?   r@   r   r"  r  s   @rD   rG  rG    s         ??+I0N NNN####     2 2 2 2 2 2 2 2rF   rG  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(...).r  mypy.types.ProperTyper   r?   r@   c                V    t                                                       || _        d S rB   )r   rE   r   )rC   r   r   s     rD   rE   zPromoteExpr.__init__:  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit__promote_exprr   s     rD   r   zPromoteExpr.accept>  rg  rF   )r   rM  r?   r@   r   )	rO   rP   rQ   rR   rS   rr   rE   r   r  r  s   @rD   rL  rL  3  sj         <<I     1 1 1 1 1 1 1 1rF   rL  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 )NewTypeExprz NewType expression NewType(...).)r   old_typer9  r   r   r  rS  r  r9  r9   r>   r:   r?   r@   c                x    t                                          ||           || _        || _        d | _        d S )N)r9   r:   )r   rE   r   rS  r9  )rC   r   rS  r9   r:   r   s        rD   rE   zNewTypeExpr.__init__O  s;     	d6222	 			rF   r   r   rU   c                ,    |                     |           S rB   )visit_newtype_exprr   s     rD   r   zNewTypeExpr.acceptW  r  rF   )
r   r   rS  r  r9   r>   r:   r>   r?   r@   r   r"  r  s   @rD   rR  rR  B  s         **,I1NIII$$$$     0 0 0 0 0 0 0 0rF   rR  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 ...).rn  r   ro  r?   r@   c                V    t                                                       || _        d S rB   rq  rr  s     rD   rE   zAwaitExpr.__init__d  rs  rF   r   r   rU   c                ,    |                     |           S rB   )visit_await_exprr   s     rD   r   zAwaitExpr.accepth  r0  rF   rw  r   r"  r  s   @rD   rX  rX  [  so         ''IN     . . . . . . . .rF   rX  c                  X     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^  FN)contextru  r_  Context | Noner?   r@   c                   t                                                       || _        || _        ||j        | _        |j        | _        dS dS )zJConstruct a dummy node; optionally borrow line/column from context object.N)r   rE   r   r^  r9   r:   )rC   ru  r^  r_  r   s       rD   rE   zTempNode.__init__~  sM     		DI!.DKKK rF   r   c                >    d| j         t          | j                  fz  S )NzTempNode:%d(%s))r9   r   r   r   s    rD   r#  zTempNode.__repr__  s     DIs49~~#>>>rF   r   r   rU   c                ,    |                     |           S rB   )visit_temp_noder   s     rD   r   zTempNode.accept  r   rF   r  )ru  r  r^  r   r_  r`  r?   r@   r   r   )
rO   rP   rQ   rR   rS   rr   rE   r#  r   r  r  s   @rD   r]  r]  o  s           #I LLL 49	)W[	) 	) 	) 	) 	) 	) 	) 	)? ? ? ?- - - - - - - -rF   r]  >   rR   rA  __dict__rE   rS   rP   __weakref__rr   __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<   ded2<   d3ed4<   d5ed6<   d7ed8<   d9ed:<   ded;<   d<ed=<   d>ed?<   g d@ZdAedB<   ds fdEZdtdFZe	dudG            Z
e	dudH            ZdvdIZdwdLZdxdNZe	dydO            Ze	dydP            ZdzdRZdudSZdvdTZd{dUZd|dWZd}dXZd~dYZdZd[dd]Zdd_Zdd`ZddcZddeZdudfZddkZddmZe ddo            Z!ddqZ"e ddr            Z# xZ$S )r   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_mror4  is_disjoint_base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_anyr1  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;  rK  type_object_typer   r   rp  r0  rq  list[TypeInfo]rr  zlist[str] | Noners  r   rt  r4  ru  mypy.types.Instance | Nonerv  rw  r   r   rx  ry  rz  zlist[tuple[str, int]]r{  rZ  r|  zset[str] | Noner}  z5list[tuple[mypy.types.Instance, mypy.types.Instance]]r~  r  zlist[mypy.types.Instance]r  r  r  r  r1  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;  rO  rK  r  r  )rx  r  r  r  r  r  ry  rz  r4  ru  r  r   FLAGSr?   r@   c                   t                                                       |j        | _        || _        || _        || _        g | _        d| _        d| _	        g | _
        g | _        d| _        d| _        d| _        d| _        d| _        g | _        g | _        d| _        g | _        g | _        g | _        d| _        d| _        d| _        d| _        |                                  d| _        d| _        d| _        d| _        d| _         g | _!        d| _"        d| _#        d| _$        d| _%        d| _&        d| _'        d| _(        i | _)        d| _*        d| _+        d| _,        d| _-        d| _.        dS )zInitialize a TypeInfo.FN)/r   rE   r   r   r   rq  rp  r1  r  r  r  rr  rs  rt  rv  rw  rx  r{  r|  r}  r~  r  r  ry  rz  r  r  add_type_varsr4  ru  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r;  rK  r  )rC   r   rq  rp  r   s       rD   rE   zTypeInfo.__init__  sx   
	&#( ',$
"&" #% $&!
!  %15"15" %$$)!!#"$(,%"' $rF   c                   d| _         | j        j        rt          | j        j                  D ]\  }}t	          |t
          j        j                  rd| _        t	          |t
          j        j	                  r;| j         rJ d| _         || _
        t          | j        j                  |z
  dz
  | _        | j                            |j                   d S d S )NFTrY   )r  rq  r1  rV  rK   r   ro  ParamSpecTyper  TypeVarTupleTyper  r   r  appendr   )rC   rZ  vds      rD   r  zTypeInfo.add_type_vars  s    ',$9 		/"49#677 / /2b$*":;; 4/3D,b$*"=>> R#;;;;37D012D.14TY5H1I1IA1MPQ1QD.%%bg....		/ 		// /rF   c                    | j         j        S )zShort name.)rq  r   r   s    rD   r   zTypeInfo.name  s     y~rF   c                    | j         S rB   r   r   s    rD   r   zTypeInfo.fullname  r   rF   c                2    t          | j                  dk    S )z7Is the type generic (i.e. does it have type variables)?r   )r   r1  r   s    rD   rG  zTypeInfo.is_generic  s    4>""Q&&rF   r   SymbolTableNode | Nonec                Z    | j         D ]"}|j                            |          }|r|c S #d S rB   )rr  r   r   )rC   r   r   ns       rD   r   zTypeInfo.get  sA    8 	 	C	d##A trF   r  c                4    | j         D ]}||j        v r|c S d S rB   )rr  r   )rC   r   r   s      rD   get_containing_type_infoz!TypeInfo.get_containing_type_info  s3    8 	 	Csy  


 !trF   c                \   t                      }| j        s
J d            | j        d d         D ]o}|j        rf|j                                        D ]L\  }}t          |j        t          t          t          f          r-|t          v r7|                    |           Mpt          |          S )Nz?This property can be only accessed after MRO is (re-)calculatedr=   )r   rr  ry  r   rH  rK   r&  r   r  r   rj  addr  )rC   membersrc  r   r&  s        rD   protocol_memberszTypeInfo.protocol_members  s      EExZZZZZZHSbSM 	& 	&D &"&*"2"2"4"4 & &JD$!$)ih-OPP ! ;;; KK%%%%grF   c                $   g }| j                                         D ]r\  }}t          |j        t                    r:t          d |j        j        D                       r|                    |           YZt          |j        t          t          f          r|t          v s$t          |          s|                    d          rt          |j        t                    r|j        j        st          j                            |j        j                  }t          |t          j        j                  r|                                r/t          |t          j        j                  r|j        j        dk    r]|                    |           t|S )Nc              3  V   K   | ]$}t          |t                    |j        d k    V  %dS )zenum.memberN)rK   r%  r   )rj   r  s     rD   r  z(TypeInfo.enum_members.<locals>.<genexpr>  sM        !#w//LM1     rF   __zenum.nonmember)r   rH  rK   r&  rD  anyrX  r  r  r   rn  r/   r   r  r   ro  get_proper_typer   r  is_type_objr.  r   )rC   r  r   symru  s        rD   enum_memberszTypeInfo.enum_members  s    ))++ -	% -	%ID# #(I.. '%  "x2     
 NN4(((  CHsHo66 % 444  5t,, 5 ch,, !86 ! *44SX]CCC"3
(?@@!ILIZIZ! #3
(;<<!  H-1AAA t$$$rF   r   c                R    |                      |          }|r|S t          |          rB   )r   KeyError)rC   r   r  s      rD   __getitem__zTypeInfo.__getitem__+  s*    HHTNN 	!H4.. rF   c                    d| j          dS )Nz
<TypeInfo r   r   r   s    rD   r#  zTypeInfo.__repr__2  s    ,DM,,,,rF   c                .    t          | t                     S rB   )rK   FakeInfor   s    rD   __bool__zTypeInfo.__bool__5  s     dH----rF   c                0    |                      |          d uS rB   )r   r"  s     rD   has_readable_memberzTypeInfo.has_readable_member;  s    xx~~T))rF   FuncBase | Decorator | Nonec                    | j         D ]R}||j        v rG|j        |         j        }t          |t                    r|c S t          |t
                    r|c S  d S Sd S rB   )rr  r   r&  rK   r  rD  )rC   r   r   r&  s       rD   
get_methodzTypeInfo.get_method>  sx    8 	  	 Csy  y+d$9::  KKKi00  KKK44 ! trF   c                   | j         }||j                            d          s|S | j        dk    r t          j                            | g           S |}| j        dd          D ]f}|j         }||j        ||}|j                            |j        j                  r=|j                            |j        j                  r|}dd } |S )Nbuiltins.typerY   )	rv  r   has_baser   r   ro  r.  rr  r   )rC   declaredwinnersuper_class
super_metas        rD   calculate_metaclass_typez!TypeInfo.calculate_metaclass_typeJ  s    *(>(>(O(OO>_,,:&&tR0008ABB< 	 	K$7J!Z_%<~#{##JO$<== ''(<== #FrF   c                   | j         }||j                            d          sd S | j        dk    rd S |}|g }nd|j        j         d| j         dg}| j        dd          D ]}|j         }||j        |.|}|                    d|j        j         d|j         d           C|j                            |j        j                  rh|j                            |j        j                  r.|}|                    d|j        j         d|j         d           d|j        j         d|j         d}d                    |           d| c S d S )Nr  "z" (metaclass of "z")rY   z > z conflicts with )rv  r   r  r   r   rr  r  join)rC   r  r  resolution_stepsr  r  conflicts          rD   explain_metaclass_conflictz#TypeInfo.explain_metaclass_conflictd  s   *(>(>(O(O4>_,,4! ^HM$: ^ ^T] ^ ^ ^_8ABB< 	O 	OK$7J!Z_%<~# ''W,WW{?SWWW   {##JO$<== ''(<== # ''W,WW{?SWWW   ^:?3^^kFZ^^^Hjj!122NNHNNNNNtrF   F)preciser  c               V    |                      d          p| j        dk    p	| j        o| S )Nr  zabc.ABCMeta)r  r   r  )rC   r  s     rD   is_metaclasszTypeInfo.is_metaclass  s7    MM/** 6}-6$4W	
rF   r   c                6    | j         D ]}|j        |k    r dS dS )zReturn True if type has a base type with the specified name.

        This can be either via extension or via implementation.
        TF)rr  r   )rC   r   r   s      rD   r  zTypeInfo.has_base  s3    
 8 	 	C|x''tt (urF   c                $    d | j         D             S )zXReturn a direct base classes.

        Omit base classes of other base classes.
        c                    g | ]	}|j         
S rT   r  )rj   rc  s     rD   rh  z0TypeInfo.direct_base_classes.<locals>.<listcomp>  s    111d	111rF   )r  r   s    rD   direct_base_classeszTypeInfo.direct_base_classes  s    
 21dj1111rF   ru  mypy.types.TupleTypec                    || _         t                              |           }| j        s	|| _        dS |j        | j        _        d| j        _        dS )z.Update tuple_type and special_alias as needed.N)r  r   from_tuple_typer  rG   _is_recursiverC   ru  aliass      rD   update_tuple_typezTypeInfo.update_tuple_type  sS    ))$//! 	4!&D(-D%/3D,,,rF   mypy.types.TypedDictTypec                    || _         t                              |           }| j        s	|| _        dS |j        | j        _        d| j        _        dS )z2Update typeddict_type and special_alias as needed.N)r  r   from_typeddict_typer  rG   r  r  s      rD   update_typeddict_typezTypeInfo.update_typeddict_type  sT    !--d33! 	4!&D(-D%/3D,,,rF   c                    t                      }|                     t          j                            |          t          j                            |                    S )zzReturn a string representation of the type.

        This includes the most important information about the type.
        r   )str_convtype_str_conv)r.   dumpr   r   r   ro  TypeStrVisitorr  s     rD   r   zTypeInfo.__str__  sT    
 ))yy\))')::*33G3DD  
 
 	
rF   r  mypy.strconv.StrConvr  mypy.types.TypeStrVisitorc                p   d}dfdd                     |           z   }| j        r*dd	                    fd
| j        D                        d}d                    d	                    fd| j        D                                 }g }t          | j                  D ]}|                     | j        |         j                  z   }| j        |         j        }	t          |	t                    r|	j
        r|d |	j
                   dz  }|                    |           d| j         d||d|fg}
| j        r'|
                    d | j                   d           | j        r'|
                    d | j                   d           t          j                            |
|          S )z5Return a string dump of the contents of the TypeInfo.r   ru  r  r?   r   c                .    |                                S rB   )r   )ru  r  s    rD   type_strzTypeInfo.dump.<locals>.type_str  s    ::m,,,rF   r   zBases(z, c              3  .   K   | ]} |          V  d S rB   rT   )rj   rc  r  s     rD   r  z TypeInfo.dump.<locals>.<genexpr>  s+      %L%Lhhtnn%L%L%L%L%L%LrF   )zMro({})c              3  R   K   | ]!}|j                             |          z   V  "d S rB   )r   	format_id)rj   r[  r  s     rD   r  z TypeInfo.dump.<locals>.<genexpr>  s8      TT4dmh&8&8&>&>>TTTTTTrF    (zName(NameszDeclaredMetaclass(zMetaclassType()r  )ru  r  r?   r   )r  r  r  formatrr  r  r   r&  rK   r  r   r  r   rv  rw  r   r   dump_tagged)rC   r  r  rc  headrr  r   r   descriptionr&  rH  r  s    ``        @rD   r  zTypeInfo.dump  s   
 	- 	- 	- 	- 	- 	- H..t444: 	PODII%L%L%L%L%L%L%LLLOOODIITTTT48TTTTT
 
 4:&& 	& 	&D!3!3DJt4D4I!J!JJK:d#(D$$$ ; ;:HHTY$7$7::::LL%%%%))))4w6FG" 	TLLRhht7N.O.ORRRSSS 	LLLJ((43F*G*GJJJKKK|''th'GGGrF   rW   c                   i ddd| j         d| j        d| j                            | j                  d| j                                        d| j        d| j        d	| j        d
d | j        D             dd | j	        D             dd | j
        D             d| j        d n| j                                        d| j        d n| j                                        d| j        d n| j                                        d| j        d n| j                                        d| j        d n| j                                        dt!          | t"          j                  | j        | j        t+          | j                  nd | j        | j        | j                                        nd | j        | j                                        nd | j        d}|S )Nr   r   rp  r   r   rq  r{  r1  r  r  c                6    g | ]}|                                 S rT   rg  rj   bs     rD   rh  z&TypeInfo.serialize.<locals>.<listcomp>  ri  rF   rr  c                    g | ]	}|j         
S rT   r  rj   cs     rD   rh  z&TypeInfo.serialize.<locals>.<listcomp>  s    1111AJ111rF   r  c                6    g | ]}|                                 S rT   rg  )rj   ps     rD   rh  z&TypeInfo.serialize.<locals>.<listcomp>  s     >>>1>>>rF   r  rv  rw  r  r  rj  )r  r}  r|  r  r  rK  )rp  r   r   r   rq  r{  r1  r  r  rr  r  r  rv  rw  r  r  rk  r   r  r  r}  r  r|  r  r  rK  r   s     rD   r   zTypeInfo.serialize  sK   "
j"
4+"
 "
 TZ))$-88	"

 DI''))"
 "4#;"
 "
 "4#;"
 88TZ888"
 11111"
 >>>>>"
 4#3#;44AQA[A[A]A]"
 !/7T=T=^=^=`=`"
  +39L9V9V9X9X#"
& $/"9$$t?X?X?Z?Z'"
( +39L9V9V9X9X+"
. YtX^44/"
0 +/:+AVDJ'''t$($=7;~7Q11333W[ 0< -77999/C"
 "
 "
F rF   r   c                B   t                               |d                   }t                              |d                   }|d         }t          |||          }|d         |_        d |d         D             |_        |d         |_        |d         |_        d	 |d
         D             |_        g }|d         D ]W}t          j
                            |          }t          |t          j
        j                  sJ |                    |           X||_        |d         d n)t          j
        j                            |d                   |_        |d         d n)t          j
        j                            |d                   |_        |d         d n)t          j
        j                            |d                   |_        |d         |_        |d         d n)t          j
        j                            |d                   |_        |d         d n)t          j
        j                            |d                   |_        |d         |_        |d         t5          |d                   nd |_        |d         |_        t;          ||d                    |d         }	|	$t          j
        j                            |	          nd |_        |                     d          %tB                              |d                   |_"        |                     d          |_#        |S )Nr   rq  rp  r   c                .    g | ]}|d          |d         fS )r   rY   rT   )rj   attrs     rD   rh  z(TypeInfo.deserialize.<locals>.<listcomp>  s%    !]!]!]47DG"4!]!]!]rF   r{  r1  r  c                V    g | ]&}t           j        j                            |          'S rT   )r   ro  r.  r   r  s     rD   rh  z(TypeInfo.deserialize.<locals>.<listcomp>  s+    NNN1DJ'33A66NNNrF   r  r  r  rv  rw  rr  r  r  r  r}  r|  rj  r  r  rK  )$r   r   r0  r   r   r{  r1  r  r  r   ro  rp  rK   rq  r  r  r.  r  rv  rw  rs  	TupleTyper  TypedDictTyper  r  r   r}  r|  rr  TypeVarTyper  r   r  r  rK  )
r   r   r   rq  rp  tir  r  r  sts
             rD   r   zTypeInfo.deserialize  s   ''W66##DL11=)eT;//J'!]!]F[A\!]!]!]K(!%&;!<NNWNNNj! 	 	A
++A..Aa!677777OOA M"* D$00m1DEE 	 ()1 D$006J1KLL 	 $%- D$006F1GHH 	 E{ L!) D%11$|2DEE 	 $%- D)55d;K6LMM 	
 :&)-g)B3tG}%%%"&'=">"d7m$$$+ACtz-99"===UY88.//;*@*L*L/0+ +B' ..	rF   r   c                F   t          |t                     | j                            || j                   | j                            |           t          || j                   t          || j                   t          |d | j	        D                        t          |d | j	        D                        t          || j                   t          || j                   t          j                            || j                   t          |d | j        D                        t          j                            || j                   t          j                            || j                   t          j                            || j                   t          j                            || j                   t          j                            || j                   t          j                            || j                   t5          || t6          j                   t          |t;          j        | j                             | j         t          |d           n2t          |d           t          |tC          | j                              t          || j"                   t          j                            || j#                   | j$        t          |d           n*t          |d           | j$                            |           tK          || j&                   d S )Nc                    g | ]\  }}|S rT   rT   )rj   r   r~  s      rD   rh  z"TypeInfo.write.<locals>.<listcomp>O      EEEDAqaEEErF   c                    g | ]\  }}|S rT   rT   )rj   r~  ss      rD   rh  z"TypeInfo.write.<locals>.<listcomp>P  r  rF   c                    g | ]	}|j         
S rT   r  r  s     rD   rh  z"TypeInfo.write.<locals>.<listcomp>T  s    ;;;Qaj;;;rF   FT)'r-   	TYPE_INFOr   r   r   rq  r)   rp  r*   r{  r&   r1  r$   r  r   ro  rQ  r  rr  r  rx  r  rv  rw  r  r  ry  r   r  jsondumpsr  r}  r  r|  r  r  r+   rK  r   s     rD   r   zTypeInfo.writeI  s   $	"""
t}---	$()))$&&&tEED,DEEEFFFtEED,DEEEFFFtT^,,,41222
""4444t;;$(;;;<<<
""4777
!!$(8999
!!$(?@@@
!!$(;<<<
!!$888
!!$(;<<<D$///$
4=11222:tU####tT"""4
!3!3444tT6777
!!$777(0tU####tT""")//555dDO,,,,,rF   c                	   t                               |          }t          |          t          k    sJ t                              |          }t          |          }t          |||          }t          |          |_        t          |          }t          |          }t          t          ||                    |_        t          |          |_        t          |          |_        g |_        t#          t%          |                    D ]b}t          |          t&          j        j        k    sJ |j                            t&          j        j                            |                     ct          |          |_        t3          t          t&          j        j                 t&          j                            |                    |_        t          |          rMt          |          t&          j        j        k    sJ t&          j        j                            |          |_        t          |          rMt          |          t&          j        j        k    sJ t&          j        j                            |          |_        t          |          rMt          |          t&          j        j        k    sJ t&          j        j                            |          |_        t          |          rMt          |          t&          j        j         k    sJ t&          j        j!                            |          |_"        t          |          rMt          |          t&          j        j#        k    sJ t&          j        j$                            |          |_%        tM          ||t          j'                   t          |          }	|	dk    rtQ          j)        |	          |_*        t          |          r!tW          t          |                    |_,        t          |          |_-        t          |          rMt          |          t&          j        j.        k    sJ t&          j        j/                            |          |_0        t          |          rtb                              |          |_2        tg          |          |_4        |S )Nz{})5r   r   r#   rP  r0  r   r   r   r    r   listzipr{  r1  r   r  r  r  r   r   ro  r2  r  r.  rs  r   rq  r  r  r  rv  rw  
TUPLE_TYPEr   r  TYPED_DICT_TYPEr  r  r  r  r  loadsr  r   r}  r|  TYPE_VAR_TYPEr  r  r  r  r!   rK  )
r   r   r   rq  rp  r  attrsstatusesr~  r  s
             rD   r   zTypeInfo.readk  s     &&~~****}}T""tnneT;//~~d## &&!%c%&:&:!;!;$T**!*4x~~&& 	< 	<AD>>TZ%88888HOODJ/44T::;;;; %T**4
 56
8Q8QRV8W8WXXT?? 	<D>>TZ%88888!Z055d;;BNT?? 	CD>>TZ%88888$(J$7$<$<T$B$BB!T?? 	?D>>TZ%88888 $
 3 8 8 > >BT?? 	<D>>TZ%::::: J055d;;BMT?? 	DD>>TZ%????? $
 8 = =d C CB4X^,,,D>>t*X..BKT?? 	0=..//BH"/"5"5T?? 	=D>>TZ%=====:166t<<BLT?? 	L*@*E*Ed*K*KB'$T**	rF   )r   r   rq  r0  rp  r   r?   r@   r  r   r  )r   r   r?   r  )r   r   r?   r  )r?   rZ  )r   r   r?   r   )r   r   r?   r   )r   r   r?   r  )r?   r  r?   rO  )r  r   r?   r   )r   r   r?   r   )r?   r  )ru  r  r?   r@   )ru  r  r?   r@   )r  r  r  r  r?   r   r   )r   rW   r?   r   r   )r   r   r?   r   )%rO   rP   rQ   rR   rS   rr   r  rE   r  r   r   r   rG  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  s   @rD   r   r     s        
 
,I\ NNN NNN   MMMNNN2222.... /...#### , DCCCJJJJ )((( MMM  
   %$$$ *))) ,+++ ,+++  4333   "!!! $### -,,, <;;;   5444  E    .% .% .% .% .% .%`/ / / /    X    X' ' ' '          X  1 1 1 X1f! ! ! !- - - -. . . .* * * *
 
 
 
   4# # # #J /4 
 
 
 
 
 
   2 2 2 2	4 	4 	4 	4	4 	4 	4 	4	
 	
 	
 	
H H H H<% % % %N ? ? ? [?B -  -  -  -D 8 8 8 [8 8 8 8 8rF   c                  "    e Zd ZdZddZdd	Zd
S )r  r  r  r   r?   r@   c                    || _         d S rB   r  )rC   r  s     rD   rE   zFakeInfo.__init__  s    rF   r  r   c                    |dk    rt                               | |          S t          t                               | d                    )Nr   r  )object__getattribute__AssertionError)rC   r  s     rD   r  zFakeInfo.__getattribute__  sA    ;**4666V44T5AABBBrF   N)r  r   r?   r@   )r  r   r?   r   )rO   rP   rQ   rS   rE   r  rT   rF   rD   r  r    sG        I,   C C C C C CrF   r  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d0d&            Zd1d(Zed2d)            Z xZS )3r   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.

    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)
    )	rG   r   alias_tvarsno_args
normalizedr  eagertvar_tuple_indexpython_3_12_type_alias)r   rG   r!  r"  NF)r!  r"  r#  r$  r&  rG   r  r   r   r9   r>   r:   r!  r9  r"  r   r#  r$  r&  r?   r@   c               H   || _         || _        |g }|| _        || _        || _        d | _        || _        |	| _        d | _        t          |          D ]+\  }
}t          |t          j        j                  r|
| _        ,t                                          ||           d S rB   )r   rG   r!  r"  r#  r  r$  r&  r%  rV  rK   r   ro  r  r   rE   )rC   rG   r   r9   r:   r!  r"  r#  r$  r&  rZ  r  r   s               rD   rE   zTypeAlias.__init__5  s     "K&$ +/
&<# $k** 	* 	*DAq!TZ899 *()%v&&&&&rF   r9  r   c           
        |j         sJ t          |j                             t          j                            |t          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).
        r3  )r  r   copy_modifiedr   ro  r.  type_vars_as_argsrq  r1  r   r9   r:   r   r9  s     rD   r  zTypeAlias.from_tuple_typeT  s~     O)),,$*66ty7JKK  *   MIK

 

 
	
rF   c           
        |j         sJ t          |j                             t          j                            |t          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*  r   ro  r.  r+  rq  r1  r   r9   r:   r,  s     rD   r  zTypeAlias.from_typeddict_typei  s     """"--,,$*66ty7JKK  .   MIK

 

 
	
rF   c                B    | j                             d          d         S Nr   r=   r   r   s    rD   r   zTypeAlias.name~      ~##C((,,rF   c                    | j         S rB   r   r   s    rD   r   zTypeAlias.fullname  r   rF   c                >    t          d | j        D                       S )Nc              3  T   K   | ]#}t          |t          j        j                  V  $d S rB   )rK   r   ro  r  rJ  s     rD   r  z0TypeAlias.has_param_spec_type.<locals>.<genexpr>  s1      UUq:a!9::UUUUUUrF   )r  r!  r   s    rD   r  zTypeAlias.has_param_spec_type  s"    UUDDTUUUUUUrF   r   r   rU   c                ,    |                     |           S rB   )visit_type_aliasr   s     rD   r   zTypeAlias.accept  r0  rF   rW   c           
         d| j         | j                                        d | j        D             | j        | j        | j        | j        | j        d	}|S )Nr   c                6    g | ]}|                                 S rT   rg  rJ  s     rD   rh  z'TypeAlias.serialize.<locals>.<listcomp>  s     DDDaAKKMMDDDrF   )	r   r   rG   r!  r"  r#  r9   r:   r&  )	r   rG   r   r!  r"  r#  r9   r:   r&  r   s     rD   r   zTypeAlias.serialize  s\    !k++--DD43CDDD|/Ik&*&A

 

 rF   r   c           
        |d         dk    sJ |d         }d |d         D             }t          d |D                       sJ t          j                            |d                   }|d         }|d	         }|d
         }|d         }|d         }	 | ||||t	          t
          t          j        j                 |          |||	          S )Nr   r   r   c                L    g | ]!}t           j                            |          "S rT   r  rJ  s     rD   rh  z)TypeAlias.deserialize.<locals>.<listcomp>  s(    SSS!tz22155SSSrF   r!  c              3  T   K   | ]#}t          |t          j        j                  V  $d S rB   )rK   r   ro  rM  r  s     rD   r  z(TypeAlias.deserialize.<locals>.<genexpr>  s1      RR:a!;<<RRRRRRrF   rG   r"  r#  r9   r:   r&  r!  r"  r#  r&  )r  r   ro  rp  r   r  rM  )
r   r   r   r!  rG   r"  r#  r9   r:   r&  s
             rD   r   zTypeAlias.deserialize  s    H~,,,,
#SStM?RSSSRRkRRRRRRRR,,T(^<<y/,'
F|h!%&>!?sT$*"<={KK!#9	
 	
 	
 		
rF   r   c                   t          |t                     t          || j                   | j                            |           t          j                            || j	                   t          || j                   t          || j                   t          || j                   t          || j                   t          || j                   d S rB   )r-   
TYPE_ALIASr)   r   rG   r   r   ro  rQ  r!  r%   r9   r:   r$   r"  r#  r&  r   s     rD   r   zTypeAlias.write  s    $
###$'''$
""4)9:::$	"""$$$$4&&&4)))4455555rF   c                `   t                    }t          j                                      }fdt	          t                              D             }t          ||t                    t                    |t                    t                    t                              S )Nc                N    g | ]!}t           j                                      "S rT   rT  r}  s     rD   rh  z"TypeAlias.read.<locals>.<listcomp>  s)    ZZZqtz44T::ZZZrF   r;  )r   r   ro  r  r  r   r   r   )r   r   r   rG   r!  s    `   rD   r   zTypeAlias.read  s    D>>%%d++ZZZZE(SW..DYDYZZZTNNTNN#dOO #,T??	
 	
 	
 		
rF   )rG   r  r   r   r9   r>   r:   r>   r!  r9  r"  r   r#  r   r$  r   r&  r   r?   r@   )r9  r   r?   r   r   r  r   r   )r   rW   r?   r   r   )r   r   r?   r   )rO   rP   rQ   rR   rS   r  rE   r   r  r  r   r   r   r  r   r   r   r   r   r  r  s   @rD   r   r     s       V Vp
I BN @D ',' ' ' ' ' ' ' '> 
 
 
 [
( 
 
 
 [
( - - - X-    X V V V XV. . . .    
 
 
 [
,	6 	6 	6 	6 
 
 
 [
 
 
 
 
rF   r   c                  d    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
dS )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)rB  r   r   r&  r   r9   r>   rB  r   r?   r@   c               >    || _         || _        || _        || _        d S rB   )r   r&  rB  r9   )rC   r   r&  r9   rB  s        rD   rE   zPlaceholderNode.__init__  s%     "	 0			rF   c                B    | j                             d          d         S r/  r   r   s    rD   r   zPlaceholderNode.name	  r0  rF   c                    | j         S rB   r   r   s    rD   r   zPlaceholderNode.fullname  r   rF   rW   c                    J d            )NFz#PlaceholderNode can't be serializedrT   r   s    rD   r   zPlaceholderNode.serialize  s    ;;;;;rF   r   r   rU   c                ,    |                     |           S rB   )visit_placeholder_noder   s     rD   r   zPlaceholderNode.accept  r  rF   N)
r   r   r&  r   r9   r>   rB  r   r?   r@   r   r   r   )rO   rP   rQ   rR   rS   rE   r   r   r   r   r   rT   rF   rD   rA  rA    s        . .` :I QV      - - - X-    X< < < <4 4 4 4 4 4rF   rA  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d,d!Zed-d"            Zd#S ).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.
    )r  r&  module_publicmodule_hidden	cross_refimplicitplugin_generatedno_serializeTF)rN  rO  r  r>   r&  SymbolNode | NonerJ  r   rM  rK  rN  rO  r?   r@   c               v    || _         || _        || _        || _        || _        d | _        || _        || _        d S rB   )r  r&  rJ  rM  rK  rL  rN  rO  )rC   r  r&  rJ  rM  rK  rN  rO  s           rD   rE   zSymbolTableNode.__init___  sF     		* *%) 0(rF   rO  c                ,    | j         | j         j        S d S rB   )r&  r   r   s    rD   r   zSymbolTableNode.fullnames  s    9 9%%4rF   r  c                    | j         }t          |t          t          f          r|j        |j        S t          |t
                    r|j        j        S d S rB   )r&  rK   r  r  r   rD  r^  )rC   r&  s     rD   r   zSymbolTableNode.typez  sQ    ydS"7899 	di>S9i(( 	8= 4rF   c                v    t          | j        | j        | j        | j        | j                  }| j        |_        |S rB   )r   r  r&  rJ  rM  rK  rL  )rC   news     rD   rR  zSymbolTableNode.copy  s8    Ity$"4dmTEW
 
 
rF   r   c                   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/r  r   : z cross_ref:)	rh   r  r1   r&  rK   r   r   r   rL  )rC   r	  s     rD   r   zSymbolTableNode.__str__  s    $)$>>z$)'<'<>>di,, 	,+di(++++A9 "ty"""A> 	0/t~///ArF   prefixr   rW   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	<   n| j        J | d|             |q| j        j	        }d|v ra||dz   |z   k    rUt          | j        t                    r| j        j        s/t          | j        t                    rJ d| d            ||d	<   |S | 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   r  TrK  FrJ  rM  rN  rL  N:r   Definition of  is unexpectedly incompleter&  )rh   r  rK  rJ  rM  rN  rK   r&  r   r   r  r  rA  r   )rC   rY  r   r   r   s        rD   r   zSymbolTableNode.serialize  ss    %6z$)?TUU 	)$(D!! 	*$)D!= 	$#D  	,'+D#$di** 	1 $	 2D9((V*<*<d*<*<(((!9-8OO FSL4$777'	377 8<@I<Y 8  *	?    N NMMMMN N N )1D%K9..00DLrF   r   c                   |d         dk    sJ t           |d                  }d|v rt          |d           }|d         |_        n>d|v s
J |            t                              |d                   }t          ||          }d|v r|d         |_        d|v r|d         |_        d|v r|d         |_        d	|v r|d	         |_        |S )
Nr   r   r  rL  r&  rK  rJ  rM  rN  )	rn   r   rL  r   r   rK  rJ  rM  rN  )r   r   r  stnoder&  s        rD   r   zSymbolTableNode.deserialize  s    H~!22222!$v,/$$T400F#K0FT>>>4>>>))$v,77D$T400Fd""#'#8F d""#'#8F ":.FO%%&*+=&>F#rF   r   c                   t          || j                   t          || j                   t          || j                   t          || j                   t          || j                   d }t          | j        t                    r| j        j
        }n| j        J | d|             |l| j        j
        }d|v r\||dz   |z   k    rPt          | j        t                    r| j        j        s*t          | j        t                    rJ d| d            |}t          ||           |%| j        J | j                            |           d S d S )Nr[  r   r\  r]  )r%   r  r$   rK  rJ  rM  rN  rK   r&  r   r   r  r  rA  r+   r   )rC   r   rY  r   rL  r   s         rD   r   zSymbolTableNode.write  s   $	"""4+,,,4+,,,4'''4.///	di** 	)	*II9((V*<*<d*<*<(((!9-8OO FSL4$777'	377 8<@I<Y 8  *	?    N NMMMMN N N !)IdI&&&9(((IOOD!!!!! rF   c                :   t          t          |          d           }t          |          |_        t          |          |_        t          |          |_        t          |          |_        t          |          }|t          |          |_	        n||_
        |S rB   )r   r   r   rK  rJ  rM  rN  r!   read_symbolr&  rL  )r   r   r  rL  s       rD   r   zSymbolTableNode.read  s~    htnnd33%dOO%dOO ( &&	"4((CHH%CM
rF   N)TFF)r  r>   r&  rP  rJ  r   rM  r   rK  r   rN  r   rO  r   r?   r@   r  r  )r?   r   r   )rY  r   r   r   r?   rW   )r   rW   r?   r   )r   r   rY  r   r   r   r?   r@   )r   r   r?   r   )rO   rP   rQ   rR   rS   rE   r   r   r   rR  r   r   r   r   r   r   rT   rF   rD   r   r     s-       9 9v	I ##) "'") ) ) ) ) )(    X    X   	 	 	 	! ! ! !F    [*" " " ":    [  rF   c                  f    e Zd ZdZdZddZddZdd	Zedd            Z	ddZ
edd            ZdS )r   zrStatic representation of a namespace dictionary.

    This is used for module, class and function namespaces.
    rT   r?   r   c                   g }|                                  D ]\  }}t          |t                    rm|j        dk    ra|j        pd                    d          d         t
          vr8|                    dt          |          z   dz   t          |          z              |                    d           t          |          }|	                    dd	           |dxx         d
z  cc<   d
                    |          S )Nbuiltinsr   r   r=   z  rX  z  <invalid item>r   zSymbolTable(r  
)rH  rK   r   r   r   rt   r  r   r  insertr  )rC   r   r  r  s       rD   r   zSymbolTable.__str__  s    **,, 
	- 
	-JC%11 -Nj00-244S99"=EZZZHHTCHH_u4s5zzABBB +,,,,1II	N###	"yy||rF   c                X    t          d |                                 D                       S )Nc                @    g | ]\  }}||                                 fS rT   )rR  )rj   r  r&  s      rD   rh  z$SymbolTable.copy.<locals>.<listcomp>  s)    MMM93S$))++.MMMrF   )r   rH  r   s    rD   rR  zSymbolTable.copy  s'    MM

MMMNNNrF   r   rW   c                    ddi}|                                  D ],\  }}|dk    s|j        r|                    ||          ||<   -|S )Nr   r   __builtins__)rH  rO  r   )rC   r   r   r  r  s        rD   r   zSymbolTable.serialize  s]    "M2**,, 	7 	7JC
 n$$(:$#66DIIrF   r   c                    |d         dk    sJ t                      }|                                D ](\  }}|dk    rt                              |          ||<   )|S )Nr   r   )r   rH  r   r   )r   r   r  r  r  s        rD   r   zSymbolTable.deserialize$  sa    H~....]]**,, 	= 	=JCh)55e<<3	rF   r   r@   c                "   d}|                                  D ]\  }}|dk    s|j        r|dz  }t          ||           t          |           D ]?}| |         }|dk    s|j        rt	          ||           |                    |||           @d S )Nr   rk  rY   )rH  rO  r%   r  r)   r   )rC   r   r   sizer  r  s         rD   r   zSymbolTable.write-  s    **,, 	 	JC
 n$$(:$AIDD$$<< 	- 	-CIEn$$(:$dC   KKh,,,,	- 	-rF   c                r    t                    }t          fdt          |          D                       S )Nc                b    g | ]+}t                    t                                        f,S rT   )r   r   r   r}  s     rD   rh  z$SymbolTable.read.<locals>.<listcomp>B  s2    ^^^QXd^^_-A-A$-G-GH^^^rF   )r   r   r  )r   r   rn  s    ` rD   r   zSymbolTable.read?  s;    ~~^^^^RWX\R]R]^^^___rF   Nr   )r?   r   )r   r   r?   rW   )r   rW   r?   r   )r   r   r   r   r?   r@   )r   r   r?   r   )rO   rP   rQ   rR   rS   r   rR  r   r   r   r   r   rT   rF   rD   r   r     s         
 I   $O O O O
 
 
 
    [- - - -$ ` ` ` [` ` `rF   r   c                  l    e Zd ZdZdZddddddddZddZedd            ZddZ	edd            Z
dS )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)rs  rt  ru  rw  rv  rs  r   rt  ru  rw  tuple[str, ...] | Nonerv  r?   r@   c               t    ||nd| _         ||nd| _        ||nd| _        ||nd| _        ||nd| _        d S )NTFrT   rr  )rC   rs  rt  ru  rw  rv  s         rD   rE   zDataclassTransformSpec.__init__Q  sc     )3(>**D.;.G]]U2A2MSX0>0JnnPU4D4P 0 0VXrF   rW   c                ^    | j         | j        | j        | j        t	          | j                  dS Nrr  )rs  rt  ru  rv  r  rw  r   s    rD   r   z DataclassTransformSpec.serializec  s6    /!/#3"1 $T%: ; ;
 
 	
rF   r   c                   t          |                    d          |                    d          |                    d          |                    d          t          |                    dg                               S )Nrs  rt  ru  rv  rw  rr  )r  r   tupler   s     rD   r   z"DataclassTransformSpec.deserializel  sq    %xx--((?33 HH%67788$455"488,>#C#CDD
 
 
 	
rF   r   c                    t          || j                   t          || j                   t          || j                   t          || j                   t          || j                   d S rB   )r$   rs  rt  ru  rv  r*   rw  r   s     rD   r   zDataclassTransformSpec.writev  sf    4)))4+,,,4-...4,---tT233333rF   c                    t          t          |          t          |          t          |          t          |          t          t          |                              S r{  )r  r   r}  r    r   s     rD   r   zDataclassTransformSpec.read}  sP    % #D//%dOO$T??"=#6#677
 
 
 	
rF   )rs  r   rt  r   ru  r   rw  rx  rv  r   r?   r@   r   )r   rW   r?   r  r   )r   r   r?   r  )rO   rP   rQ   rR   rS   rE   r   r   r   r   r   rT   rF   rD   r  r  E  s        < <I #'%)'+37 '+Y Y Y Y Y Y$
 
 
 
 
 
 
 [
4 4 4 4 
 
 
 [
 
 
rF   r  r&  r   rZ  c                       fd|D             S )Nc                4    g | ]}t          |          |S rT   )getattr)rj   r   r&  s     rD   rh  zget_flags.<locals>.<listcomp>  s(    :::TgdD&9&9:D:::rF   rT   )r&  r   s   ` rD   rk  rk    s    ::::U::::rF   rj  r@   c                2    |D ]}t          | |d           d S r  )setattr)r&  rj  r   s      rD   rr  rr    s0     " "dD!!!!" "rF   r   r   c                L    |D ] }t          | t          ||                     !d S rB   )r$   r  r   r&  rj  r   s       rD   ry  ry    s8     . .4t,,----. .rF   c                P    |D ]"}t          |           rt          ||d           #d S r  )r   r  r  s       rD   r  r    s<     & &T?? 	&D$%%%& &rF   ro  rO  c                    d}t          | j        t                    r| j        j        }n.t          | j        t                    rt          | j                  }|dS | 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   )rK   ro  r  r   r6  get_member_expr_fullname)ro  initials     rD   r  r    sk     G$)X&& 6).	DIz	*	* 6*4955t##	###rF   c                    i | ]V\  }}t          |          t          ur;t          |t                     r&t          |t                    r|t          uN||j        WS rT   )r   r  rK   
issubclassr   r   )rj   r  objs      rD   rm   rm     sn       SCyy  3 !3
## ! 	: 
 	rF   r   r  rR  nodeslist[T]failCallable[[str, T], None]c                   d}d}d}d}t          | |          D ]\  }}|t          k    r|s|s|s|r |d|            d S (|t          k    r|s|s|r |d|            d S d}K|t          k    r|s|s|r |d|            d S d}n|t          k    s|t
          k    rd}|r |d|            d S |t          k    r|r |d|            d S d}d S )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)r  r  r  rA  rE  rF  rG  )	r  r  r  
is_var_arg	is_kw_arg
seen_namedseen_optr  r&  s	            rD   check_arg_kindsr    s    JIJH)U++  
d7?? Y *  ^    W__ Y * UW[\\\HHX Y * FMMMJJY$-"7"7J DdKKK Y >EEEI7 rF   function definitionSequence[str | None]r  r   c                    t                      }t          | |          D ]5\  }}|||v r |d| d| |            d S |                    |           6d S )NzDuplicate argument "z" in )r   r  r  )r   r  r  r  
seen_namesr   r&  s          rD   check_arg_namesr    s     #&%%J%''  
d
 2 2D@@@;@@$GGGEEt	 rF   r   c                R    t          | j        t                    r| j        j        S dS )z.Return whether the expression is ClassVar[...]F)rK   r&  r  r  rn  s    rD   is_class_varr    s&    $)S!! %y$$5rF   rP  c                `    t          | t          t          t          t          f          o| j        S )z6Check whether `node` corresponds to a final attribute.)rK   r  rC  rG  rD  r4  r6  s    rD   is_final_noder    s#    dS'+<iHII[dm[rF   ru  mypy.types.CallableTypec                L    | j         }t          |t                    r|j        }|S rB   )
definitionrK   rD  rY  )ru  r  s     rD   get_func_defr    s(    J*i(( %_
rF   name_prefixr9  r  r   c              #  (  K   |                                  D ]z\  }}|}d|v r|                    d          d         }|dz   |z   }|j        }|rC|j        |k    r8|||fV  t	          |t
                    rt          |j        ||          E d{V  {dS )zIterate over local definitions (not imported) in a symbol table.

    Recursively iterate over class members and nested classes.
    z-redefr   r   N)rH  r   r&  r   rK   r   r   r   )r   r  r9  r   symnode	shortnamer   r&  s           rD   r   r     s        
I 
Ig	t

8,,Q/I$y0| 	IDMX--GT))))$)) I,TZ4HHHHHHHHH
I 
IrF   z
Final[Tag]r
  rw  r  r  r=  r  r>  r     r#     r0     r  	   r=  
   rP  mypy.nodes.SymbolNodec                   t          |           }|t          k    r$t          j        j                            |           S |t          k    r$t          j        j                            |           S |t          k    r$t          j        j	                            |           S |t          k    r$t          j        j                            |           S |t          k    r$t          j        j                            |           S |t          k    r$t          j        j                            |           S |t           k    r$t          j        j                            |           S |t$          k    r$t          j        j                            |           S |t(          k    r$t          j        j                            |           S J d|             )NFzUnknown symbol tag )r#   r  r   r  r  r   r  rC  r  rD  r  r   rw  rG  r  r  r=  r   r#  r  r0  r&  r   tags     rD   rb  rb    se   
4..C
czzz~""4(((
hz!&&t,,,
iz#((...
iz"''---
!!!z+00666
mz%**4000
jz#((...
oz',,T222
!!!z*//555-------rF   c                    t          |           }|t          k    rt                              |           S |t          k    rt
                              |           S J d|             )NFz Invalid tag for an OverloadPart )r#   r  rD  r   r  rC  r  s     rD   r|  r|  6  s\    
4..C
i~~d###
h||D!!!::S:::::rF   )r  r  r?   r  )r&  r   r   rZ  r?   rZ  )r&  r   rj  rZ  r?   r@   )r   r   r&  r   rj  rZ  r?   r@   )ro  r6  r?   rO  )r  rR  r  r  r  r  r?   r@   )r  )
r   r  r  r  r  r  r  r   r?   r@   )ro  r  r?   r   )r&  rP  r?   r   )ru  r  r?   rP  rB   )r   r   r  r   r9  r  r?   r   )r   r   r?   r  )r   r   r?   rE  )rR   
__future__r   r  r   abcr   collectionsr   collections.abcr   r   enumr   r	   typingr
   r   r   r   r   r   r   r   typing_extensionsr   rV   r   mypy_extensionsr   mypy.strconvr   
mypy.cacher   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   mypy.optionsr.   	mypy.utilr/   r0   r1   mypy.visitorr2   r3   r4   mypy.patternsr5   r7   
mypy.typesrU   r?  r   rW   rr   rX   rZ   r\   r^   r_   r`   ra   rb   rc   rh   rH  rn   rt   r~   r   r   r   r   r   r   r   r   r   r   r   r}  r   r   r  r  r$  r,  r5  r7  rE  rG  r  r  r  r  r  r  r  r  r  r  r  rC  r  rD  r  r  r0  rX  rc  r  rm  ry  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  r6  r  r  r  rA  rE  rG  rF  r  rO  rX  r]  rb  ri  rn  rs  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&  r5  r;  rB  rG  rL  rR  rX  r]  	frozensetrj  rn  r   r  r  r>  r=  r  rA  r   r   r  rk  rr  ry  r  r  globalsr   r  r  r  r  r  r   r
  rw  r  r  r  r  r#  r0  r  r=  rP  rb  r|  rT   rF   rD   <module>r     s   : : : " " " " " "  				       # # # # # # . . . . . . . .         V V V V V V V V V V V V V V V V V V V V @ @ @ @ @ @ @ @ ! ! ! ! ! !                                                         6 !           = = = = = = = = = = I I I I I I I I I I &%%%%%%%) %) %) %) %) %) %) %)P   GCLLCH~ % % % %                         
    64v?OQbc
 c c c cQQj>N>N>P>PQQQ  Q Q Q Q #"%         #" ,-+3'3*       (>w&G  G G G G
 &?'5	$ $      #" ,	" "     !           : : : : :7 : : :" : : : : : : : : : : : : : : : :    Z          !Q !Q !Q !Q !Q !Q !Q !QJ s$5x
7KKL
 L L L L_ _ _ _ _z _ _ _D" " " " " " " "2* * * * *Z * * *"/ / / / / / / /*. . . . .
 . . .& MLL L L L L?< ?< ?< ?< ?<t ?< ?< ?<D !!78 8 8 8 8Y= Y= Y= Y= Y=*i Y= Y= Y=x"W "W "W "W "Wt "W "W "WL                     $ ' * * *     7! 7! 7! 7! 7!x 7! 7! 7!t & ) ) )                   f f f f fh
I f f fZ !27;  ; ; ; ;Q& Q& Q& Q& Q&
I Q& Q& Q&h  	    2n n n n n* n n nb{ { { { {y { { {|/ / / / / / / /"1 1 1 1 19 1 1 1") ) ) ) )I ) ) ),3 3 3 3 3Y 3 3 3"@3 @3 @3 @3 @3Y @3 @3 @3F< < < < <Y < < <*. . . . .	 . . .&3, 3, 3, 3, 3,i 3, 3, 3,l/ / / / / / / // / / / / / / /", , , , ,i , , ,. . . . .	 . . .1 1 1 1 19 1 1 1- - - - -y - - -+ + + + +Y + + +&. . . . .	 . . .$", ", ", ", ",i ", ", ",J- - - - -y - - -B. . . . .	 . . .<3 3 3 3 3I 3 3 34, , , , ,j , , ,., , , , ,j , , ,": : : :. . . . .
 . . .4. . . . .
 . . ."0 0 0 0 0* 0 0 0", , , , ,: , , ,- - - - -z - - -** * * * *j * * *Z6 6 6 6 6w 6 6 6./ / / / / / / /( 5 5 5 5 5d 5 5 5<                 " " " " "$	 $ $ $ $$	 $ $ $ $, , , , ,Wh	9mT	 T T T T!- !- !- !- !-z !- !- !-H3 3 3 3 3J 3 3 3. . . . .
 . . .. . . . .
 . . .:. . . . .
 . . .,3 3 3 3 3Z 3 3 3 ++ ++ ++ ++ ++Z ++ ++ ++\3 3 3 3 3Z 3 3 3:. . . . .
 . . .:- - - - -z - - -&4 4 4 4 4Z 4 4 4&/ / / / / / / /8. . . . .
 . . .*    :   0- - - - -z - - -"- - - - -z - - -". . . . .
 . . .&, , , , ,j , , ,"2 2 2 2 2J 2 2 2@6 6 6 6 6
 6 6 6"5 5 5 5 5z 5 5 5" <  <  <  <  <j  <  <  <F4 4 4 4 4j 4 4 4*4 4 4 4 4j 4 4 48 	    	             . . . . .j* . . .f (7&8  8 8 8 8N
 N
 N
 N
 N
/ N
 N
 N
b-
 -
 -
 -
 -
O -
 -
 -
`E
 E
 E
 E
 E
 E
 E
 E
P3 3 3 3 3J 3 3 3"3 3 3 3 3Z 3 3 3*2 2 2 2 2J 2 2 2$2 2 2 2 2: 2 2 2.1 1 1 1 1* 1 1 10 0 0 0 0* 0 0 02. . . . .
 . . .(- - - - -z - - -F '0i  ' '     $ #,),P,P,P"Q"Q  Q Q Q Q} } } } }z } } }@C C C C Cx C C CB  (x(=>> > > > >$,H-G$H$H  H H H H ()M N N N N N N"(#OPP  P P P P}
 }
 }
 }
 }

 }
 }
 }
@G4 G4 G4 G4 G4j G4 G4 G4T` ` ` ` ` ` ` `FG` G` G` G` G`$sO+, G` G` G`T@
 @
 @
 @
 @
 @
 @
 @
F; ; ; ;" " " "
. . . .
& & & &$ $ $ $  GIIOO%%      " " " "R -	       \ \ \ \
    CGI I I I I* 	    "#  # # # #    	                "#  # # # #	    
    	    . . . .0; ; ; ; ; ;rF   