AlkantarClanX12

Your IP : 3.142.98.60


Current Path : /opt/alt/python37/lib64/python3.7/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/lib2to3/fixes/__pycache__/fix_isinstance.cpython-37.pyc

B

� fH�@s2dZddlmZddlmZGdd�dej�ZdS)a,Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed.  This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.

eg.  isinstance(x, (int, long)) -> isinstance(x, (int, int))
       -> isinstance(x, int)
�)�
fixer_base)�tokenc@s eZdZdZdZdZdd�ZdS)�
FixIsinstanceTz�
    power<
        'isinstance'
        trailer< '(' arglist< any ',' atom< '('
            args=testlist_gexp< any+ >
        ')' > > ')' >
    >
    �cCs�t�}|d}|j}g}t|�}xx|D]p\}}	|	jtjkrt|	j|krt|t|�dkr�||djtjkr�t	|�q&q&|�
|	�|	jtjkr&|�|	j�q&W|r�|djtjkr�|d=t|�dkr�|j}
|
j
|d_
|
�|d�n||dd�<|��dS)N�args�����)�setZchildren�	enumerate�typer�NAME�value�len�COMMA�next�append�add�parent�prefix�replaceZchanged)�selfZnodeZresultsZnames_insertedZtestlistrZnew_args�iterator�idx�argZatom�r�A/opt/alt/python37/lib64/python3.7/lib2to3/fixes/fix_isinstance.py�	transforms*$
zFixIsinstance.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrrrrrrsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>
s