Your IP : 3.139.86.58


Current Path : /opt/alt/python36/lib64/python3.6/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/lib2to3/fixes/__pycache__/fix_has_key.cpython-36.opt-2.pyc

3

��2a|�@s>ddlmZddlmZddlmZmZGdd�dej�ZdS)�)�pytree)�
fixer_base)�Name�parenthesizec@seZdZdZdZdd�ZdS)�	FixHasKeyTa�
    anchor=power<
        before=any+
        trailer< '.' 'has_key' >
        trailer<
            '('
            ( not(arglist | argument<any '=' any>) arg=any
            | arglist<(not argument<any '=' any>) arg=any ','>
            )
            ')'
        >
        after=any*
    >
    |
    negation=not_test<
        'not'
        anchor=power<
            before=any+
            trailer< '.' 'has_key' >
            trailer<
                '('
                ( not(arglist | argument<any '=' any>) arg=any
                | arglist<(not argument<any '=' any>) arg=any ','>
                )
                ')'
            >
        >
    >
    c

Cs||j}|jj|jkr&|jj|j�r&dS|jd�}|d}|j}dd�|dD�}|dj�}|jd�}	|	rxdd�|	D�}	|j|j	|j|j
|j|j|j
|jfkr�t|�}t|�d	kr�|d
}ntj|j|�}d|_tddd
�}
|r�tddd
�}tj|j||
f�}
tj|j	||
|f�}|	�r8t|�}tj|j|ft|	��}|jj|j	|j|j|j|j|j|j|j|jf	k�rrt|�}||_|S)N�negation�anchorcSsg|]}|j��qS�)�clone)�.0�nr	r	�0/opt/alt/python36/lib64/python3.6/fix_has_key.py�
<listcomp>Rsz'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSsg|]}|j��qSr	)r
)rrr	r	r
rVs��� �in)�prefix�not)�syms�parent�typeZnot_test�pattern�match�getrr
Z
comparisonZand_testZor_testZtestZlambdef�argumentr�lenrZNodeZpowerrZcomp_op�tuple�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactor)
�selfZnode�resultsrrrrrrrZn_opZn_not�newr	r	r
�	transformGsD


zFixHasKey.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr%r	r	r	r
r&srN)�rrZ
fixer_utilrrZBaseFixrr	r	r	r
�<module>!s

?>