Your IP : 18.117.72.244


Current Path : /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_has_key.cpython-35.opt-2.pyc



���]��@scddlmZddlmZddlmZddlmZmZGdd�dej�Z	dS)�)�pytree)�token)�
fixer_base)�Name�parenthesizec@s(eZdZdZdZdd�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|jkr7|jj|j�r7dS|jd�}|d}|j}dd�|dD�}|dj�}|jd�}	|	r�dd�|	D�}	|j|j	|j|j
|j|j|j
|jfkr�t|�}t|�d	kr|d
}ntj|j|�}d|_tdd
d�}
|rotdd
d�}tj|j||
f�}
tj|j	||
|f�}|	r�t|�}tj|j|ft|	��}|jj|j	|j|j|j|j|j|j|j|jf	krt|�}||_|S)N�negation�anchorcSsg|]}|j��qS�)�clone)�.0�nr
r
�0/opt/alt/python35/lib64/python3.5/fix_has_key.py�
<listcomp>Ss	z'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSsg|]}|j��qSr
)r)rr
r
r
rrWs	��� �in�prefix�not)�syms�parent�typeZnot_test�pattern�match�getrrZ
comparisonZand_testZor_testZtestZlambdef�argumentr�lenrZNodeZpowerrZcomp_op�tuple�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactor)
�selfZnode�resultsrrr	rrrrZn_opZn_not�newr
r
r�	transformHsD	
	!
	"	zFixHasKey.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr&r
r
r
rr'srN)
�rZpgen2rrZ
fixer_utilrrZBaseFixrr
r
r
r�<module>!s

?>