Your IP : 3.129.195.82
�
�Q�ff � � � d Z ddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZ dZ G d� dej � Zd � Zd
� Zd� Zy)
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 � � 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| j |t
� d| _ y d| _ 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.pyr zFixNext.start_tree$ sA �� �
�g�t�'��h�7����&����L�L��L�)�!%�D��!&�D�� c �, � |j d� }|j d� }|j d� }|r�| j r'|j t d|j �� � y |D �cg c] }|j � �� }}d|d _ |j t
t d|j �� |� � y |r)t d|j �� }|j |� y |r{t |� rU|d }dj |D �cg c]
}t |� �� c}� j � d
k( r| j |t � y |j t d� � y d|v r| j |t � d| _ y y c c}w c c}w )
N�base�attr�name�__next__)�prefix� � r
�head�__builtin__�globalT)
�getr �replacer r �cloner �is_assign_target�join�str�stripr r )r �node�resultsr r r r r"