Your IP : 18.118.19.89


Current Path : /opt/alt/python312/lib64/python3.12/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/lib2to3/fixes/__pycache__/fix_next.cpython-312.opt-2.pyc

�

�Q�ff��~�	ddlmZddlmZddlmZddlmZm	Z	m
Z
dZGd�dej�Z
d�Zd	�Zd
�Zy)�)�token)�python_symbols)�
fixer_base)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingc�0��eZdZdZdZdZ�fd�Zd�Z�xZS)�FixNextTa�
    power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
    |
    power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
    |
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def'
                              name='next'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    |
    global=global_stmt< 'global' any* 'next' any* >
    �prec���tt|�||�td|�}|r|j	|t
�d|_yd|_y)N�nextTF)�superr
�
start_treer�warning�bind_warning�
shadowed_next)�self�tree�filename�n�	__class__s    ��=/opt/alt/python312/lib64/python3.12/lib2to3/fixes/fix_next.pyrzFixNext.start_tree$sA���
�g�t�'��h�7����&����L�L��L�)�!%�D��!&�D��c�,�|jd�}|jd�}|jd�}|r�|jr'|jtd|j���y|D�cgc]}|j���}}d|d_|jt
td|j��|��y|r)td|j��}|j|�y|r{t|�rU|d	}dj|D�cgc]
}t|���c}�j�d
k(r|j|t�y|jtd��yd|vr|j|t�d|_yycc}wcc}w)
N�base�attr�name�__next__)�prefix��r
�head�__builtin__�globalT)
�getr�replacerr�cloner�is_assign_target�join�str�striprr)r�node�resultsrrrrr"s        r�	transformzFixNext.transform.sD���{�{�6�"���{�{�6�"���{�{�6�"����!�!����T�*�T�[�[�A�B�+/�0�4�a����	�4��0�!#��Q������T�$�v�d�k�k�"B�D�I�J�
��Z����4�A��L�L��O�
� ��%��v����7�7�D�1�D�q�C��F�D�1�2�8�8�:�m�K��L�L��|�4���L�L��j�)�*�
��
 ��L�L��|�,�!%�D��!��!1��2s�-F�
F)	�__name__�
__module__�__qualname__�
BM_compatible�PATTERN�orderrr.�
__classcell__)rs@rr
r
s ����M�
�G�
�E�'�&rr
c��t|�}|�y|jD]/}|jtjk(ryt||�s�/yy)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r,�assign�childs   rr(r(QsG��
��
�F�
�~�������:�:����$��
��t�
$��	!�
rc��|jtjk(r|S|jtjk(s|j�yt|j�S�N)r9�syms�	expr_stmt�simple_stmt�parentr7)r,s rr7r7]sD���y�y�D�N�N�"����y�y�D�$�$�$����(;���t�{�{�#�#rc�L��|�k(ryt�fd�|jD��S)NTc3�6�K�|]}t|�����y�wr?)r;)�.0�cr,s  �r�	<genexpr>zis_subtree.<locals>.<genexpr>gs�����:�M�q�z�!�T�"�M�s�)�anyr8)�rootr,s `rr;r;ds"����t�|���:�D�M�M�:�:�:rN)�pgen2r�pygramrr@r r�
fixer_utilrrrr�BaseFixr
r(r7r;�rr�<module>rPs@��4��+��1�1�L��:&�j� � �:&�@
�$�;r

?>