{ ~ d Z ddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZ dZ G d dej
Zd Zd
Zd ZdS )
z.Fixer for it.next() -> next(it), per PEP 3114. )token)python_symbols)
fixer_base)NameCallfind_bindingz;Calls to builtin next() possibly shadowed by global bindingc 0 e Zd ZdZdZdZ fdZd 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 )NnextTF)superr
start_treer warningbind_warning
shadowed_next)selftreefilenamen __class__s C/opt/alt/python-internal/lib64/python3.11/lib2to3/fixes/fix_next.pyr zFixNext.start_tree$ sj
gt''h777&& 'LLL)))!%D!&D c d |sJ | 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 |rt
| rZ|d
}d d |D dk r| |t d S | t d d S d
|v r$| |t d| _ d S d S )Nbaseattrname__next__)prefixc 6 g | ]}| S )clone.0r s r