Your IP : 18.118.1.63
�
c��ff � �| � d dl mZ d dlmZ d dlmZ d dlmZm Z m
Z
dZ G d� dej � � Z
d� Zd � Zd
� ZdS )� )�token)�python_symbols)�
fixer_base)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingc �0 � � e Zd ZdZdZdZ� 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 �� �� t t | � � � ||� � t d|� � }|r$| � |t
� � d| _ d S d| _ d S )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.pyr zFixNext.start_tree$ sj �� �
�g�t���'�'��h�7�7�7����&�&��� '��L�L��L�)�)�)�!%�D����!&�D���� c �\ � |� d� � }|� d� � }|� d� � }|r�| j r+|� t d|j �� � � � d S d� |D � � }d|d _ |� t t d |j �� � |� � � � d S |r-t d|j �� � }|� |� � d S |r�t
|� � rZ|d
}d� d� |D � � � � � � � dk r| � |t � � d S |� t d� � � � d S d
|v r$| � |t � � d| _ d S d S )N�base�attr�name�__next__)�prefixc �6 � g | ]}|� � � ��S � )�clone��.0r s r �
<listcomp>z%FixNext.transform.<locals>.<listcomp>9 s � �0�0�0�a���� � �0�0�0r � � r
�headc �, � g | ]}t |� � ��S r! )�strr# s r r% z%FixNext.transform.<locals>.<listcomp>E s � �1�1�1�q�C��F�F�1�1�1r �__builtin__�globalT)�getr �replacer r r �is_assign_target�join�stripr r )r �node�resultsr r r r r( s r � transformzFixNext.transform. s� � � �{�{�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�orderr r4 �
__classcell__)r s @r r
r
sZ �� � � � � ��M�
�G�
�E�'� '� '� '� '�&� &� &� &� &� &� &r r
c � � t | � � }|�dS |j D ]-}|j t j k r dS t || � � r dS �.dS )NFT)�find_assign�children�typer �EQUAL�
is_subtree)r2 �assign�childs r r/ r/ Q sc � �
��
�
�F�
�~��u��� � ���:���$�$��5�5�
��t�
$�
$� ��4�4� ��5r c � � | j t j k r| S | j t j k s| j �d S t | j � � S �N)r? �syms� expr_stmt�simple_stmt�parentr= )r2 s r r= r= ] sB � ��y�D�N�"�"����y�D�$�$�$���(;��t��t�{�#�#�#r c �T �� | �k rdS t �fd�| j D � � � � S )NTc 3 �8 �K � | ]}t |�� � V � �d S rE )rA )r$ �cr2 s �r � <genexpr>zis_subtree.<locals>.<genexpr>g s- �� � � �:�:�q�z�!�T�"�"�:�:�:�:�:�:r )�anyr>