Ë
    pPêjî  ã                  óš   — U d dl mZ d dlmZ d dlmZ d dlmZm	Z	m
Z
mZmZmZ d dlmZmZmZmZmZmZ eeegdf   Zded<    G d	„ d
«      Zy)é    )Úannotations)ÚCallable)Ú	TypeAlias)ÚContextÚParamSpecExprÚSymbolTableNodeÚTypeVarExprÚTypeVarLikeExprÚTypeVarTupleExpr)ÚParamSpecFlavorÚParamSpecTypeÚ	TypeVarIdÚTypeVarLikeTypeÚTypeVarTupleTypeÚTypeVarTypeNÚ
_TypeAliasÚFailFuncc                  ó�   — e Zd ZdZ	 	 	 	 d	 	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Zdd„Z		 	 	 	 	 	 	 	 	 	 dd	„Z
dd
„Zdd„Zdd„Zy)ÚTypeVarLikeScopezvScope that holds bindings for type variables and parameter specifications.

    Node fullname -> TypeVarLikeType.
    Nc                ó°   — i | _         || _        d| _        d| _        || _        || _        || _        |�#|j                  | _        |j                  | _        yy)aV  Initializer for TypeVarLikeScope

        Parameters:
          parent: the outer scope for this scope
          is_class_scope: True if this represents a generic class
          prohibited: Type variables that aren't strictly in scope exactly,
                      but can't be bound because they're part of an outer class's scope.
        r   N)ÚscopeÚparentÚfunc_idÚclass_idÚis_class_scopeÚ
prohibitedÚ	namespace)Úselfr   r   r   r   s        úT/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypy/tvar_scope.pyÚ__init__zTypeVarLikeScope.__init__    sW   € ð 24ˆŒ
ØˆŒØˆŒØˆŒØ,ˆÔØ$ˆŒØ"ˆŒØÐØ!Ÿ>™>ˆDŒLØ"ŸO™OˆD�Mð ó    c                ó\   — | }|�'|j                   r|j                  }|�|j                   rŒ|S )zAGet the nearest parent that's a function scope, not a class scope)r   r   )r   Úits     r   Úget_function_scopez#TypeVarLikeScope.get_function_scope:   s1   € à&*ˆØˆn ×!2Ò!2Ø—‘ˆBð ˆn ×!2Ó!2àˆ	r!   c                óÂ   — || j                   v ry| j                  r| j                  j                  |«      sy| j                  r| j                  j                  |«      syy)NFT)r   r   Úallow_bindingr   )r   Úfullnames     r   r&   zTypeVarLikeScope.allow_bindingA   sJ   € Ø�t—z‘zÑ!ØØ�[Š[ §¡×!:Ñ!:¸8Ô!DØØ�_Š_ T§_¡_×%BÑ%BÀ8Ô%LØØr!   c                ó    — t        | dd|¬«      S )z&A new scope frame for binding a methodFN©r   )r   ©r   r   s     r   Úmethod_framezTypeVarLikeScope.method_frameJ   s   € ä  e¨T¸YÔGÐGr!   c                ó<   — t        | j                  «       d| |¬«      S )zEA new scope frame for binding a class. Prohibits *this* class's tvarsTr)   )r   r$   r*   s     r   Úclass_framezTypeVarLikeScope.class_frameN   s   € ä × 7Ñ 7Ó 9¸4ÀÐQZÔ[Ð[r!   c                óV   — | xj                   dz  c_         t        | j                   «      S )zHUsed by plugin-like code that needs to make synthetic generic functions.é   )r   r   )r   s    r   Únew_unique_func_idz#TypeVarLikeScope.new_unique_func_idR   s   € à�Š˜Ñ�Ü˜Ÿ™Ó&Ð&r!   c                ó’  — | j                   r"| xj                  dz  c_        | j                  }n!| xj                  dz  c_        | j                  }| j                  }t	        |t
        «      rft        ||j                  t        ||¬«      |j                  |j                  |j                  |j                  |j                  |j                  ¬«	      }nÜt	        |t        «      r_t!        ||j                  t        ||¬«      t"        j$                  |j                  |j                  |j                  |j                  ¬«      }nmt	        |t&        «      r[t)        ||j                  t        ||¬«      |j                  |j*                  |j                  |j                  |j                  ¬«      }nJ ‚|| j,                  |j                  <   |S )Nr/   r)   )	Únamer'   ÚidÚvaluesÚupper_boundÚdefaultÚvarianceÚlineÚcolumn)r2   r'   r3   Úflavorr5   r6   r8   r9   )r2   r'   r3   r5   Útuple_fallbackr6   r8   r9   )r   r   r   r   Ú
isinstancer	   r   r'   r   r4   r5   r6   r7   r8   r9   r   r   r   ÚBAREr   r   r;   r   )r   r2   Ú	tvar_exprÚ	fail_funcÚcontextÚir   Útvar_defs           r   Úbind_newzTypeVarLikeScope.bind_newW   sq  € ð ×ÒØ�MŠM˜QÑ�MØ—‘‰Aà�LŠL˜AÑ�LØ—‘ˆAØ—N‘Nˆ	ä�i¤Ô-Ü(3ØØ"×+Ñ+Ü˜Q¨)Ô4Ø ×'Ñ'Ø%×1Ñ1Ø!×)Ñ)Ø"×+Ñ+Ø—^‘^Ø ×'Ñ'ô
)‰Hô ˜	¤=Ô1Ü$ØØ"×+Ñ+Ü˜Q¨)Ô4Ü&×+Ñ+Ø%×1Ñ1Ø!×)Ñ)Ø—^‘^Ø ×'Ñ'ô	‰Hô ˜	Ô#3Ô4Ü'ØØ"×+Ñ+Ü˜Q¨)Ô4Ø%×1Ñ1Ø(×7Ñ7Ø!×)Ñ)Ø—^‘^Ø ×'Ñ'ô	‰Hð �5Ø)1ˆ�
‰
�9×%Ñ%Ñ&Øˆr!   c                ó6   — || j                   |j                  <   y ©N)r   r'   )r   rB   s     r   Úbind_existingzTypeVarLikeScope.bind_existing‰   s   € Ø(0ˆ�
‰
�8×$Ñ$Ò%r!   c                óÐ   — t        |t        «      r|j                  n|}|sJ ‚|| j                  v r| j                  |   S | j                  �| j                  j                  |«      S y rE   )r<   r   r'   r   r   Úget_binding)r   Úitemr'   s      r   rH   zTypeVarLikeScope.get_bindingŒ   sZ   € Ü$.¨t´_Ô$E�4—=’=È4ˆÙˆˆxØ�t—z‘zÑ!Ø—:‘:˜hÑ'Ð'Ø�[‰[Ð$Ø—;‘;×*Ñ*¨8Ó4Ð4àr!   c                ó    — dj                  d„ | j                  j                  «       D «       «      }| j                  €|S | j                  › d|› �S )Nz, c              3  ó^   K  — | ]%  \  }}|› d |j                   › d|j                  › �–— Œ' y­w)z: ú`N)r2   r3   )Ú.0ÚkÚvs      r   ú	<genexpr>z+TypeVarLikeScope.__str__.<locals>.<genexpr>—   s-   è ø€ ÒN±4°1°a˜!˜˜B˜qŸv™v˜h a¨¯© vÔ.ÑNùs   ‚+-z <- )Újoinr   Úitemsr   )r   Úmes     r   Ú__str__zTypeVarLikeScope.__str__–   sG   € Ø�Y‰YÑN¸4¿:¹:×;KÑ;KÓ;MÔNÓNˆØ�;‰;ÐØˆIØ—+‘+�˜d 2 $Ð'Ð'r!   )NFNÚ )
r   úTypeVarLikeScope | Noner   Úboolr   rV   r   ÚstrÚreturnÚNone)rY   rV   )r'   rX   rY   rW   )r   rX   rY   r   )rY   r   )
r2   rX   r>   r
   r?   r   r@   r   rY   r   )rB   r   rY   rZ   )rI   zstr | SymbolTableNoderY   zTypeVarLikeType | None)rY   rX   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    r$   r&   r+   r-   r0   rC   rF   rH   rT   © r!   r   r   r      s¢   „ ñð +/Ø$Ø.2Øð,à'ð,ð ð,ð ,ð	,ð
 ð,ð 
ó,ó4óóHó\ó'ð
0Øð0Ø$3ð0Ø@Hð0ØSZð0à	ó0ód1óô(r!   r   )Ú
__future__r   Úcollections.abcr   Útypingr   r   Ú
mypy.nodesr   r   r   r	   r
   r   Ú
mypy.typesr   r   r   r   r   r   rX   r   Ú__annotations__r   r_   r!   r   ú<module>rf      sH   ðÞ "å $Ý *÷÷ ÷÷ ð    g °Ð 4Ñ5€ˆ*Ó 5÷@(ò @(r!   