Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python38/lib64/python3.8/lib2to3/fixes/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python38/lib64/python3.8/lib2to3/fixes/__pycache__/fix_next.cpython-38.pyc
U

��,af�@sndZddlmZddlmZddlmZddlm	Z	m
Z
mZdZGdd�dej
�Zd	d
�Zdd�Zd
d�ZdS)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 bindingcs0eZdZdZdZdZ�fdd�Zdd�Z�ZS)�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* >
    Zprecs>tt|��||�td|�}|r4|�|t�d|_nd|_dS)N�nextTF)�superr�
start_treer�warning�bind_warning�
shadowed_next)�selfZtree�filename�n��	__class__��;/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_next.pyr$s
zFixNext.start_treecCs|st�|�d�}|�d�}|�d�}|rz|jrF|�td|jd��n2dd�|D�}d|d	_|�ttd
|jd�|��n�|r�td|jd�}|�|�nl|r�t|�r�|d}d�dd�|D���	�d
kr�|�
|t�dS|�td��nd|k�r|�
|t�d|_dS)N�base�attr�name�__next__)�prefixcSsg|]}|���qSr)Zclone��.0rrrr�
<listcomp>9sz%FixNext.transform.<locals>.<listcomp>��r	�headcSsg|]}t|��qSr)�strrrrrrEsZ__builtin__�globalT)�AssertionError�getr�replacerrr�is_assign_target�join�striprr
)r�nodeZresultsrrrrr rrr�	transform.s.




zFixNext.transform)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERN�orderrr*�
__classcell__rrrrrs

rcCsFt|�}|dkrdS|jD]&}|jtjkr0dSt||�rdSqdS)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r)ZassignZchildrrrr&Qs

r&cCs4|jtjkr|S|jtjks&|jdkr*dSt|j�S�N)r2�symsZ	expr_stmtZsimple_stmt�parentr0�r)rrrr0]s
r0cs$|�krdSt�fdd�|jD��S)NTc3s|]}t|��VqdSr5)r4)r�cr8rr�	<genexpr>gszis_subtree.<locals>.<genexpr>)�anyr1)�rootr)rr8rr4dsr4N)�__doc__Zpgen2rZpygramrr6rrZ
fixer_utilrrrr
ZBaseFixrr&r0r4rrrr�<module>s@

ZeroDay Forums Mini