
    X-PhP                       d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZ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! ddl"m#Z# ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ ddlAmBZB ddlCmDZDmEZE d#dZFd$dZGd%dZH ede          ZI G d de#          ZJ G d de4d                    ZKd&d"ZLd S )'a	  Merge a new version of a module AST and symbol table to older versions of those.

When the source code of a module has a change in fine-grained incremental mode,
we build a new AST from the updated source. However, other parts of the program
may have direct references to parts of the old AST (namely, those nodes exposed
in the module symbol table). The merge operation changes the identities of new
AST nodes that have a correspondence in the old AST to the old ones so that
existing cross-references in other modules will continue to point to the correct
nodes. Also internal cross-references within the new AST are replaced. AST nodes
that aren't externally visible will get new, distinct object identities. This
applies to most expression and statement nodes, for example.

We perform this merge operation so that we don't have to update all
external references (which would be slow and fragile) or always perform
translation when looking up references (which would be hard to retrofit).

The AST merge operation is performed after semantic analysis. Semantic
analysis has to deal with potentially multiple aliases to certain AST
nodes (in particular, MypyFile nodes). Type checking assumes that we
don't have multiple variants of a single AST node visible to the type
checker.

Discussion of some notable special cases:

* If a node is replaced with a different kind of node (say, a function is
  replaced with a class), we don't perform the merge. Fine-grained dependencies
  will be used to rebind all references to the node.

* If a function is replaced with another function with an identical signature,
  call sites continue to point to the same object (by identity) and don't need
  to be reprocessed. Similarly, if a class is replaced with a class that is
  sufficiently similar (MRO preserved, etc.), class references don't need any
  processing. A typical incremental update to a file only changes a few
  externally visible things in a module, and this means that often only few
  external references need any processing, even if the modified module is large.

* A no-op update of a module should not require any processing outside the
  module, since all relevant object identities are preserved.

* The AST diff operation (mypy.server.astdiff) and the top-level fine-grained
  incremental logic (mypy.server.update) handle the cases where the new AST has
  differences from the old one that may need to be propagated to elsewhere in the
  program.

See the main entry point merge_asts for more details.
    )annotations)TypeVarcast)MDEFSYMBOL_NODE_EXPRESSION_TYPESAssertTypeExprAssignmentStmtBlockCallExprCastExprClassDefEnumCallExprFuncBaseFuncDef
LambdaExpr
MemberExprMypyFileNamedTupleExprNameExprNewTypeExprOverloadedFuncDefRefExpr	Statement	SuperExpr
SymbolNodeSymbolTable	TypeAliasTypedDictExprTypeInfoVar)TraverserVisitor)AnyTypeCallableArgumentCallableTypeDeletedTypeEllipsisType
ErasedTypeInstanceLiteralTypeNoneType
Overloaded
ParametersParamSpecTypePartialTypePlaceholderTypeRawExpressionTypeSyntheticTypeVisitor	TupleTypeTypeTypeAliasTypeTypedDictTypeTypeListTypeTypeTypeVarTupleTypeTypeVarTypeUnboundTypeUninhabitedType	UnionType
UnpackType)
type_state)
get_prefixreplace_object_stateoldr   old_symbolsr   newnew_symbolsreturnNonec                    |j         | j         k    sJ t          ||| j                   }| ||<   t          ||          }|| u sJ t          ||           dS )a  Merge a new version of a module AST to a previous version.

    The main idea is to preserve the identities of externally visible
    nodes in the old AST (that have a corresponding node in the new AST).
    All old node state (outside identity) will come from the new AST.

    When this returns, 'old' will refer to the merged AST, but 'new_symbols'
    will be the new symbol table. 'new' and 'old_symbols' will no longer be
    valid.
    )prefixN)fullname!replacement_map_from_symbol_tablereplace_nodes_in_astreplace_nodes_in_symbol_table)rA   rB   rC   rD   replacement_mapnodes         T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypy/server/astmerge.py
merge_astsrP   t   sz     <3<'''' 8[  O OC  _55D3;;;; "+?????    rH   strdict[SymbolNode, SymbolNode]c                   i }|                                  D ]Y\  }}||v rN|j        t          k    s&|j        r6t	          |j        j                  |k    r||         }t          |j                  t          |j                  k    r|j        r|j        r|j        j        |j        j        k    r|j        |j        k    r|j        ||j        <   t          |j        t                    rt          |j        t                    rkt          |j        j
        |j        j
        |          }|                    |           |j        j        r%|j        j        r|j        j        ||j        j        <   [|S )ao  Create a new-to-old object identity map by comparing two symbol table revisions.

    Both symbol tables must refer to revisions of the same module id. The symbol tables
    are compared recursively (recursing into nested class symbol tables), but only within
    the given module prefix. Don't recurse into other modules accessible through the symbol
    table.
    )itemskindr   rN   r?   rI   type
isinstancer   rJ   namesupdatespecial_alias)rA   rC   rH   replacementsnamerN   new_node	type_repls           rO   rJ   rJ      s^    24Liikk \ \
d3;;Iz$):L/M/MQW/W/W4yHX]##tDI66M 7I 7 M*di.@@@MTY...2iX]+di22 \z(-QY7Z7Z \ A	)<f! !I !''	222y. \8=3N \DHID[X]%@ArQ   rN   r   r\   c                v    t          |          }|                     |           |                    | |           S )a%  Replace all references to replacement map keys within an AST node, recursively.

    Also replace the *identity* of any nodes that have replacements. Return the
    *replaced* version of the argument node (which may have a different identity, if
    it's included in the replacement map).
    )NodeReplaceVisitoracceptget)rN   r\   visitors      rO   rK   rK      s9     !..GKKD$'''rQ   SN)boundc                  X    e Zd ZdZdGdZdH fd	ZdI fdZdJ fdZdK fdZdL fdZ	dMdZ
dNdZdOdZdPdZdQ fdZdRdZdS fd ZdTd"ZdU fd$ZdV fd&ZdW fd(ZdX fd*ZdY fd,ZdZ fd.Zd[ fd0Zd\ fd2Zd] fd4Zd^ fd6Zd_ fd8Zd`d:Zdad<Zdbd?ZdcdBZ dddCZ!dedFZ" xZ#S )fra   zTransform some nodes to new identities in an AST.

    Only nodes that live in the symbol table may be
    replaced, which simplifies the implementation some. Also
    replace all references to the old identities.
    r\   rS   rE   rF   c                    || _         d S Nr\   selfr\   s     rO   __init__zNodeReplaceVisitor.__init__       (rQ   rN   r   c                    |                      |          }|                     |j                  |_        t                                          |           d S ri   )fixupreplace_statementsdefssupervisit_mypy_filerl   rN   	__class__s     rO   rt   z"NodeReplaceVisitor.visit_mypy_file   sI    zz$++DI66	%%%%%rQ   r
   c                    |                      |j                  |_        t                                          |           d S ri   )rq   bodyrs   visit_blockru   s     rO   ry   zNodeReplaceVisitor.visit_block   s8    ++DI66	D!!!!!rQ   r   c                    |                      |          }|                     |           t                                          |           d S ri   )rp   process_base_funcrs   visit_func_defru   s     rO   r|   z!NodeReplaceVisitor.visit_func_def   sF    zz$t$$$t$$$$$rQ   r   c                t    |                      |           t                                          |           d S ri   )r{   rs   visit_overloaded_func_defru   s     rO   r~   z,NodeReplaceVisitor.visit_overloaded_func_def   s5    t$$$))$/////rQ   r   c                   |                      |j                  |_        |                     |j        j                  |j        _        |j        }|j        D ],}t          |t                    r|                     |           -|r2|j	        r| 
                    |           n|                     |           t                                          |           d S ri   )fixup_and_reset_typeinfoinforq   rr   rx   	type_varsrX   r9   process_type_var_defis_named_tupleprocess_synthetic_type_infoprocess_type_infors   visit_class_def)rl   rN   r   tvrv   s       rO   r   z"NodeReplaceVisitor.visit_class_def   s    11$)<<	00@@	y. 	. 	.B"k** .))"--- 	-" -006666&&t,,,%%%%%rQ   r   c                    |                      |j                   |                     |j                  |_        |j        r|                      |j                   d S d S ri   )
fixup_typerW   rp   r   unanalyzed_typerl   rN   s     rO   r{   z$NodeReplaceVisitor.process_base_func   s[    	"""JJty))	 	2OOD011111	2 	2rQ   r   r9   c                    |j         D ]}|                     |           |                     |j                   |                     |j                   d S ri   )valuesr   upper_bounddefault)rl   r   values      rO   r   z'NodeReplaceVisitor.process_type_var_def   sV    Y 	# 	#EOOE""""'''
#####rQ   r-   c                n    |                      |j                   |                      |j                   d S ri   r   r   r   rl   r   s     rO   process_param_spec_defz)NodeReplaceVisitor.process_param_spec_def   0    '''
#####rQ   r8   c                n    |                      |j                   |                      |j                   d S ri   r   r   s     rO   process_type_var_tuple_defz-NodeReplaceVisitor.process_type_var_tuple_def  r   rQ   r	   c                ~    |                      |j                   t                                          |           d S ri   )r   rW   rs   visit_assignment_stmtru   s     rO   r   z(NodeReplaceVisitor.visit_assignment_stmt  s5    	"""%%d+++++rQ   r   c                0    |                      |           d S ri   )visit_ref_exprr   s     rO   visit_name_exprz"NodeReplaceVisitor.visit_name_expr  s    D!!!!!rQ   r   c                    |j         r|                     |j                   |_         |                     |           t                                          |           d S ri   )def_varrp   r   rs   visit_member_exprru   s     rO   r   z$NodeReplaceVisitor.visit_member_expr  sT    < 	4::dl33DLD!!!!!$'''''rQ   r   c                    |j         U|                     |j                   |_         t          |j         t                    r|j                             |            d S d S d S ri   )rN   rp   rX   r    rb   r   s     rO   r   z!NodeReplaceVisitor.visit_ref_expr  sa    9 

49--DI$)S)) '	  &&&&&	 ! ' 'rQ   r   c                    t                                          |           |                     |j                  |_        |                     |j                   d S ri   )rs   visit_namedtuple_exprr   r   r   ru   s     rO   r   z(NodeReplaceVisitor.visit_namedtuple_expr  sN    %%d+++11$)<<	((33333rQ   r   c                ~    t                                          |           |                     |j                   d S ri   )rs   visit_cast_exprr   rW   ru   s     rO   r   z"NodeReplaceVisitor.visit_cast_expr"  s5    %%%	"""""rQ   r   c                ~    t                                          |           |                     |j                   d S ri   )rs   visit_assert_type_exprr   rW   ru   s     rO   r   z)NodeReplaceVisitor.visit_assert_type_expr&  s5    &&t,,,	"""""rQ   r   c                    t                                          |           |j        !|                     |j                  |_        d S d S ri   )rs   visit_super_exprr   rp   ru   s     rO   r   z#NodeReplaceVisitor.visit_super_expr*  sD      &&&9 

49--DIII ! rQ   r   c                    t                                          |           t          |j        t                    r!|                     |j                  |_        d S d S ri   )rs   visit_call_exprrX   analyzedr   rp   ru   s     rO   r   z"NodeReplaceVisitor.visit_call_expr/  sS    %%%dm%ABB 	6 JJt}55DMMM	6 	6rQ   r   c                    |j         r9|                     |j                   |_         |                     |j                    |                     |j                   t                                          |           d S ri   )r   r   r   r   old_typers   visit_newtype_exprru   s     rO   r   z%NodeReplaceVisitor.visit_newtype_expr4  sl    9 	855di@@DI,,TY777&&&""4(((((rQ   r   c                    |                      |j                  |_        t                                          |           d S ri   )rp   r   rs   visit_lambda_exprru   s     rO   r   z$NodeReplaceVisitor.visit_lambda_expr;  s6    JJty))	!!$'''''rQ   r   c                    t                                          |           |                     |j                  |_        |                     |j                   d S ri   )rs   visit_typeddict_exprr   r   r   ru   s     rO   r   z'NodeReplaceVisitor.visit_typeddict_expr?  sN    $$T***11$)<<	((33333rQ   r   c                    |                      |j                  |_        |                     |j                   t                                          |           d S ri   )r   r   r   rs   visit_enum_call_exprru   s     rO   r   z'NodeReplaceVisitor.visit_enum_call_exprD  sN    11$)<<	((333$$T*****rQ   r    c                    |                      |j                  |_        |                     |j                   |                     |j                   t                                          |           d S ri   )rp   r   r   rW   setter_typers   	visit_varru   s     rO   r   zNodeReplaceVisitor.visit_varK  s_    JJty))		"""()))$rQ   r   c                    |                      |j                   |j        D ]}|                      |           t                                          |           d S ri   )r   targetalias_tvarsrs   visit_type_alias)rl   rN   vrv   s      rO   r   z#NodeReplaceVisitor.visit_type_aliasQ  s\    $$$! 	 	AOOA  &&&&&rQ   re   c                   || j         v r|| j         |         }d}t          |t                    r1t          |t                    rd}t          |j        |j                   t          |||           t          t          |          S |S )N r[   
skip_slots)r\   rX   r   r@   r[   r   re   )rl   rN   rC   r   s       rO   rp   zNodeReplaceVisitor.fixupY  s    4$$$#D)C*,J$)) Ljh.G.G L 0
$S%68JKKK dzBBBBC== rQ   r   c                    || j         v r8| j         |         }t          |t                    sJ t          j        |           |                     |          S )zFix-up type info and reset subtype caches.

        This needs to be called at least once per each merged TypeInfo, as otherwise we
        may leak stale caches.
        )r\   rX   r   r>   reset_all_subtype_caches_forrp   rl   rN   rC   s      rO   r   z+NodeReplaceVisitor.fixup_and_reset_typeinfof  sZ     4$$$ #D)Cc8,,,,,3C888zz$rQ   typType | Nonec                \    |)|                     t          | j                             d S d S ri   )rb   TypeReplaceVisitorr\   rl   r   s     rO   r   zNodeReplaceVisitor.fixup_typet  s2    ?JJ)$*;<<===== ?rQ   r   TypeInfo | Nonec                   |d S |                      |j                   |                      |j                   |j        D ]}|                      |           |                      |j                   |                      |j                   |j        r|                      |j        j                   |                     |          |j	        _
        t          |j        | j                   t          |j                  D ]-\  }}|                     |j        |                   |j        |<   .t          |j                  D ]%\  }}|                      |j        |                    &d S ri   )r   declared_metaclassmetaclass_type_promote
tuple_typetypeddict_typer[   r   rp   defnr   rL   rY   r\   	enumeratemrobases)rl   r   r   iitembases         rO   r   z$NodeReplaceVisitor.process_type_infox  sP   <F/000+,,,m 	$ 	$FOOF####(((+,,, 	7OOD.5666D))	%dj$2CDDD ** 	2 	2GAt**TXa[11DHQKK ,, 	+ 	+GAtOODJqM****	+ 	+rQ   c                    |                      |           |j                                        D ]#}|j        r|j                            |            $d S ri   )r   rY   r   rN   rb   )rl   r   rN   s      rO   r   z.NodeReplaceVisitor.process_synthetic_type_info  s`     	t$$$J%%'' 	' 	'Dy '	  &&&	' 	'rQ   nodeslist[Statement]c                    g }|D ]A}t          |t                    r|                     |          }|                    |           B|S ri   )rX   r   rp   append)rl   r   resultrN   s       rO   rq   z%NodeReplaceVisitor.replace_statements  sS     	  	 D$
++ (zz$''MM$rQ   r\   rS   rE   rF   )rN   r   rE   rF   )rN   r
   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )r   r9   rE   rF   )r   r-   rE   rF   )r   r8   rE   rF   )rN   r	   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r   rE   rF   )rN   r    rE   rF   )rN   r   rE   rF   rN   re   rE   re   )rN   r   rE   r   )r   r   rE   rF   )r   r   rE   rF   )r   r   rE   rF   )r   r   rE   r   )$__name__
__module____qualname____doc__rm   rt   ry   r|   r~   r   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   r   rq   __classcell__)rv   s   @rO   ra   ra      sI        ) ) ) )& & & & & &
" " " " " "% % % % % %
0 0 0 0 0 0& & & & & &2 2 2 2$ $ $ $$ $ $ $$ $ $ $, , , , , ," " " "( ( ( ( ( (' ' ' '4 4 4 4 4 4
# # # # # ## # # # # #. . . . . .
6 6 6 6 6 6
) ) ) ) ) )( ( ( ( ( (4 4 4 4 4 4
+ + + + + +           ' ' ' ' ' '          > > > >+ + + +$' ' ' '       rQ   ra   c                      e Zd ZdZdAdZdBd	ZdCdZdDdZdEdZdFdZ	dGdZ
dHdZdIdZdJdZdKdZdLdZdMd ZdNd"ZdOd$ZdPd&ZdQd(ZdRd*ZdSd,ZdTd.ZdUd0ZdVd2ZdWd4ZdXd6ZdYd8ZdZd:Zd[d<Zd\d?Zd@S )]r   zSimilar to NodeReplaceVisitor, but for type objects.

    Note: this visitor may sometimes visit unanalyzed types
    such as 'UnboundType' and 'RawExpressionType' For example, see
    NodeReplaceVisitor.process_base_func.
    r\   rS   rE   rF   c                    || _         d S ri   rj   rk   s     rO   rm   zTypeReplaceVisitor.__init__  rn   rQ   r   r(   c                    |                      |j                  |_        |j        D ]}|                    |            |j        r|j                            |            d S d S ri   )rp   rW   argsrb   last_known_valuerl   r   args      rO   visit_instancez!TypeReplaceVisitor.visit_instance  so    ::ch''8 	 	CJJt 	. ''-----	. 	.rQ   r4   c                    |j         J |                     |j                   |_         |j        D ]}|                    |            d S ri   )aliasrp   r   rb   r   s      rO   visit_type_alias_typez(TypeReplaceVisitor.visit_type_alias_type  sU    y$$$JJsy))	8 	 	CJJt	 	rQ   r"   c                    d S ri   r   r   s     rO   	visit_anyzTypeReplaceVisitor.visit_any      rQ   r*   c                    d S ri   r   r   s     rO   visit_none_typez"TypeReplaceVisitor.visit_none_type  r   rQ   r$   c                   |j         D ]}|                    |            |j                            |            |j        r*| j                            |j        |j                  |_        |j        |j                            |            |j        D ]P}t          |t                    r9|j
                            |            |j        D ]}|                    |            Qd S ri   )	arg_typesrb   ret_type
definitionr\   rc   fallback	variablesrX   r9   r   r   )rl   r   r   r   r   s        rO   visit_callable_typez&TypeReplaceVisitor.visit_callable_type  s    = 	 	CJJtD!!!> 	S!.223>3>RRCN<#L%%%- 	' 	'B"k** '%%d+++Y ' 'ELL&&&&		' 	'rQ   tr+   c                    |j         D ]}|                    |            |j        |j                            |            d S d S ri   )rU   rb   r   rl   r   r   s      rO   visit_overloadedz#TypeReplaceVisitor.visit_overloaded  sT    G 	 	DKK:!Jd##### "!rQ   r'   c                     t          d          )NzCannot handle erased typeRuntimeErrorrl   r   s     rO   visit_erased_typez$TypeReplaceVisitor.visit_erased_type  s    6777rQ   r%   c                    d S ri   r   r   s     rO   visit_deleted_typez%TypeReplaceVisitor.visit_deleted_type  r   rQ   r.   c                     t          d          )NzCannot handle partial typer  r   s     rO   visit_partial_typez%TypeReplaceVisitor.visit_partial_type  s    7888rQ   r2   c                    |j         D ]}|                    |            |j        |j                            |            d S d S ri   )rU   rb   partial_fallbackrl   r   r   s      rO   visit_tuple_typez#TypeReplaceVisitor.visit_tuple_type  sV    I 	 	DKK+ ''----- ,+rQ   r7   c                :    |j                             |            d S ri   )r   rb   r   s     rO   visit_type_typez"TypeReplaceVisitor.visit_type_type      rQ   r9   c                    |j                             |            |j                            |            |j        D ]}|                    |            d S ri   )r   rb   r   r   )rl   r   r   s      rO   visit_type_varz!TypeReplaceVisitor.visit_type_var  s^    t$$$4   Z 	 	ELL	 	rQ   r-   c                n    |j                             |            |j                            |            d S ri   r   rb   r   r   s     rO   visit_param_specz#TypeReplaceVisitor.visit_param_spec  4    t$$$4     rQ   r8   c                n    |j                             |            |j                            |            d S ri   r  r   s     rO   visit_type_var_tuplez'TypeReplaceVisitor.visit_type_var_tuple  r  rQ   r=   c                :    |j                             |            d S ri   )rW   rb   r   s     rO   visit_unpack_typez$TypeReplaceVisitor.visit_unpack_type  r  rQ   r,   c                D    |j         D ]}|                    |            d S ri   )r   rb   r   s      rO   visit_parametersz#TypeReplaceVisitor.visit_parameters  s2    = 	 	CJJt	 	rQ   r5   c                    |j                                         D ]}|                    |            |j                            |            d S ri   )rU   r   rb   r   )rl   r   
value_types      rO   visit_typeddict_typez'TypeReplaceVisitor.visit_typeddict_type  sR    )**,, 	$ 	$Jd####D!!!!!rQ   r0   c                    d S ri   r   r  s     rO   visit_raw_expression_typez,TypeReplaceVisitor.visit_raw_expression_type  r   rQ   r)   c                :    |j                             |            d S ri   )r   rb   r   s     rO   visit_literal_typez%TypeReplaceVisitor.visit_literal_type  s    D!!!!!rQ   r:   c                D    |j         D ]}|                    |            d S ri   r   rb   r   s      rO   visit_unbound_typez%TypeReplaceVisitor.visit_unbound_type  s2    8 	 	CJJt	 	rQ   r6   c                D    |j         D ]}|                    |            d S ri   rU   rb   r  s      rO   visit_type_listz"TypeReplaceVisitor.visit_type_list	  2    I 	 	DKK	 	rQ   r#   c                :    |j                             |            d S ri   )r   rb   r   s     rO   visit_callable_argumentz*TypeReplaceVisitor.visit_callable_argument  s    trQ   r&   c                    d S ri   r   r   s     rO   visit_ellipsis_typez&TypeReplaceVisitor.visit_ellipsis_type  r   rQ   r;   c                    d S ri   r   r   s     rO   visit_uninhabited_typez)TypeReplaceVisitor.visit_uninhabited_type  r   rQ   r<   c                D    |j         D ]}|                    |            d S ri   r(  r  s      rO   visit_union_typez#TypeReplaceVisitor.visit_union_type  r*  rQ   r/   c                D    |j         D ]}|                    |            d S ri   r%  r   s      rO   visit_placeholder_typez)TypeReplaceVisitor.visit_placeholder_type  s2    F 	 	DKK	 	rQ   rN   re   c                \    || j         v r"| j         |         }t          t          |          S |S ri   )r\   r   re   r   s      rO   rp   zTypeReplaceVisitor.fixup   s0    4$$$#D)CC== rQ   Nr   )r   r(   rE   rF   )r   r4   rE   rF   )r   r"   rE   rF   )r   r*   rE   rF   )r   r$   rE   rF   )r   r+   rE   rF   )r   r'   rE   rF   )r   r%   rE   rF   )r   r.   rE   rF   )r   r2   rE   rF   )r   r7   rE   rF   )r   r9   rE   rF   )r   r-   rE   rF   )r   r8   rE   rF   )r   r=   rE   rF   )r   r,   rE   rF   )r   r5   rE   rF   )r   r0   rE   rF   )r   r)   rE   rF   )r   r:   rE   rF   )r   r6   rE   rF   )r   r#   rE   rF   )r   r&   rE   rF   )r   r;   rE   rF   )r   r<   rE   rF   )r   r/   rE   rF   r   ) r   r   r   r   rm   r   r   r   r   r   r   r  r  r	  r  r  r  r  r  r  r  r  r!  r#  r&  r)  r,  r.  r0  r2  r4  rp   r   rQ   rO   r   r     sN        ) ) ) ). . . .         ' ' ' ' $ $ $ $8 8 8 8   9 9 9 9. . . .      ! ! ! !! ! ! !      " " " "
   " " " "                          rQ   r   Nsymbolsc                >   |                                  D ]}|j        r~|j        |v r-||j                 }|j        }t          ||d           ||_        t          |j        t          t
          f          r'|j                            t          |                     d S )Nr   r   )r   rN   r@   rX   r    r   rb   ra   )r6  r\   rN   rC   rA   s        rO   rL   rL   '  s        
C 
C9 		CyL(("49-i$S#:LMMMM	$)c9%566 C	  !3L!A!ABBB
C 
CrQ   )
rA   r   rB   r   rC   r   rD   r   rE   rF   )rA   r   rC   r   rH   rR   rE   rS   )rN   r   r\   rS   rE   r   )r6  r   r\   rS   rE   rF   )Mr   
__future__r   typingr   r   
mypy.nodesr   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    mypy.traverserr!   
mypy.typesr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   mypy.typestater>   	mypy.utilr?   r@   rP   rJ   rK   re   ra   r   rL   r   rQ   rO   <module>r?     s  - -^ # " " " " "                                                                         : , + + + + +                                                           < & % % % % % 6 6 6 6 6 6 6 6@ @ @ @>   D( ( ( ( WT$$$S S S S S) S S SlH H H H H-d3 H H HVC C C C C CrQ   