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_xrange.cpython-38.pyc
U

��,a�
�@sFdZddlmZddlmZmZmZddlmZGdd�dej�Z	dS)z/Fixer that changes xrange(...) into range(...).�)�
fixer_base)�Name�Call�consuming_calls)�patcompcsheZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
Z
e�e
�Z
dZe�e�Zdd�Z�ZS)�	FixXrangeTz�
              power<
                 (name='range'|name='xrange') trailer< '(' args=any ')' >
              rest=any* >
              cstt|��||�t�|_dS�N)�superr�
start_tree�set�transformed_xranges��selfZtree�filename��	__class__��=/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_xrange.pyr
szFixXrange.start_treecCs
d|_dSr)rr
rrr�finish_treeszFixXrange.finish_treecCsD|d}|jdkr|�||�S|jdkr4|�||�Stt|���dS)N�nameZxrange�range)�value�transform_xrange�transform_range�
ValueError�repr�r�node�resultsrrrr�	transforms

zFixXrange.transformcCs0|d}|�td|jd��|j�t|��dS)Nrr��prefix)�replacerr!r�add�idrrrrr$szFixXrange.transform_xrangecCsft|�|jkrb|�|�sbttd�|d��g�}ttd�|g|jd�}|dD]}|�|�qN|SdS)Nr�args�listr �rest)r$r�in_special_contextrrZcloner!Zappend_child)rrrZ
range_callZ	list_call�nrrrr*s��zFixXrange.transform_rangez3power< func=NAME trailer< '(' node=any ')' > any* >z�for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
            | comparison< any 'in' node=any any*>
         cCsf|jdkrdSi}|jjdk	rJ|j�|jj|�rJ|d|krJ|djtkS|j�|j|�od|d|kS)NFr�func)�parent�p1�matchrr�p2)rrrrrrr(?s
�
�zFixXrange.in_special_context)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrZP1rZcompile_patternr,ZP2r.r(�
__classcell__rrrrrs	

rN)
�__doc__�rZ
fixer_utilrrrrZBaseFixrrrrr�<module>s

ZeroDay Forums Mini