ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/fix_next.cpython-311.pyc

�

�ff��~�dZddlmZddlmZddlmZddlm	Z	m
Z
mZdZGd�dej
��Zd	�Zd
�Zd�ZdS)
z.Fixer for it.next() -> next(it), per PEP 3114.�)�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$|�|t
��d|_dSd|_dS)N�nextTF)�superr
�
start_treer�warning�bind_warning�
shadowed_next)�self�tree�filename�n�	__class__s    ��=/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_next.pyrzFixNext.start_tree$sj���
�g�t���'�'��h�7�7�7����&�&���	'��L�L��L�)�)�)�!%�D����!&�D����c�d�|sJ�|�d��}|�d��}|�d��}|r�|jr+|�td|j�����dSd�|D��}d|d_|�ttd	|j���|����dS|r-td|j���}|�|��dS|r�t
|��rZ|d
}d�d�|D�������dkr|�	|t��dS|�td����dSd
|vr$|�	|t��d|_dSdS)N�base�attr�name�__next__)�prefixc�6�g|]}|�����S�)�clone��.0rs  r�
<listcomp>z%FixNext.transform.<locals>.<listcomp>9s ��0�0�0�a����	�	�0�0�0r��r
�headc�,�g|]}t|����Sr!)�strr#s  rr%z%FixNext.transform.<locals>.<listcomp>Es��1�1�1�q�C��F�F�1�1�1r�__builtin__�globalT)�getr�replacerrr�is_assign_target�join�striprr)r�node�resultsrrrrr(s        r�	transformzFixNext.transform.s������w��{�{�6�"�"���{�{�6�"�"���{�{�6�"�"���	&��!�
K����T�*�T�[�A�A�A�B�B�B�B�B�0�0�4�0�0�0��!#��Q������T�$�v�d�k�"B�"B�"B�D�I�I�J�J�J�J�J�
�	&��Z���4�4�4�A��L�L��O�O�O�O�O�
�	&� ��%�%�
��v����7�7�1�1�D�1�1�1�2�2�8�8�:�:�m�K�K��L�L��|�4�4�4����L�L��j�)�)�*�*�*�*�*�
��
 �
 ��L�L��|�,�,�,�!%�D����!�
 r)	�__name__�
__module__�__qualname__�
BM_compatible�PATTERN�orderrr4�
__classcell__)rs@rr
r
sZ��������M�
�G�
�E�'�'�'�'�'�&�&�&�&�&�&�&rr
c��t|��}|�dS|jD]-}|jtjkrdSt||��rdS�.dS)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r2�assign�childs   rr/r/Qsc��
��
�
�F�
�~��u�������:���$�$��5�5�
��t�
$�
$�	��4�4�	��5rc��|jtjkr|S|jtjks|j�dSt|j��S�N)r?�syms�	expr_stmt�simple_stmt�parentr=)r2s rr=r=]sB���y�D�N�"�"����y�D�$�$�$���(;��t��t�{�#�#�#rc�T��|�krdSt�fd�|jD����S)NTc3�8�K�|]}t|���V��dSrE)rA)r$�cr2s  �r�	<genexpr>zis_subtree.<locals>.<genexpr>gs-�����:�:�q�z�!�T�"�"�:�:�:�:�:�:r)�anyr>)�rootr2s `rrArAds6����t�|�|��t��:�:�:�:�D�M�:�:�:�:�:�:rN)�__doc__�pgen2r�pygramrrFr&r�
fixer_utilrrrr�BaseFixr
r/r=rAr!rr�<module>rUs���4�4�������+�+�+�+�+�+�������1�1�1�1�1�1�1�1�1�1�L��:&�:&�:&�:&�:&�j� �:&�:&�:&�@
�
�
�$�$�$�;�;�;�;�;r

Zerion Mini Shell 1.0