Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3.10/lib2to3/fixes/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3.10/lib2to3/fixes/__pycache__/fix_has_key.cpython-310.pyc
o

��bc|�@sBdZddlmZddlmZddlmZmZGdd�dej�ZdS)a&Fixer for has_key().

Calls to .has_key() methods are expressed in terms of the 'in'
operator:

    d.has_key(k) -> k in d

CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
   fixer will change any has_key() method call, regardless of its
   class.

2) Cases like this will not be converted:

    m = d.has_key
    if m(k):
        ...

   Only *calls* to has_key() are converted. While it is possible to
   convert the above to something like

    m = d.__contains__
    if m(k):
        ...

   this is currently not done.
�)�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�|sJ�|j}|jj|jkr|j�|j�rdS|�d�}|d}|j}dd�|dD�}|d��}|�d�}	|	r@dd�|	D�}	|j|j	|j|j
|j|j|j
|jfvrWt|�}t|�d	krb|d
}nt�|j|�}d|_tddd
�}
|r�tddd
�}t�|j||
f�}
t�|j	||
|f�}|	r�t|�}t�|j|ft|	��}|jj|j	|j|j|j|j|j|j|j|jf	vr�t|�}||_|S)N�negation�anchorcS�g|]}|���qS���clone��.0�nr
r
�0/usr/lib/python3.10/lib2to3/fixes/fix_has_key.py�
<listcomp>R�z'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSr	r
rr
r
r
rrVr��� �in)�prefix�not)�syms�parent�type�not_test�pattern�match�getrr�
comparison�and_test�or_test�test�lambdef�argumentr�lenr�Node�powerr�comp_op�tuple�expr�xor_expr�and_expr�
shift_expr�
arith_expr�term�factor)
�self�node�resultsrrrrrrr�n_op�n_not�newr
r
r�	transformGsL�

�
�zFixHasKey.transformN)�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr;r
r
r
rr&srN)	�__doc__�rr�
fixer_utilrr�BaseFixrr
r
r
r�<module>s


Spamworldpro Mini