| Server IP : 66.29.146.62 / Your IP : 216.73.216.152 Web Server : LiteSpeed System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : dokkdzvi ( 925) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/ |
Upload File : |
�
��f� c @ si d Z d d l m Z d d l m Z d d l m Z d d l m Z m Z Gd d � d e j � Z
d S( u& 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.
i ( u pytree( u token( u
fixer_base( u Nameu parenthesizec B s, | Ee Z d Z d Z d Z d d � Z d S( u FixHasKeyu�
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
C s1 | j } | j j | j k r7 | j j | j � r7 d S| j d � } | d } | j } d d � | d D� } | d j � } | j d � } | r� d d � | D� } n | j | j
| j | j | j | j
| j | j f k r� t | � } n t | � d k r| d
} n t j | j | � } d | _ t d d
d �}
| rxt d d
d �} t j | j | |
f � }
n t j | j
| |
| f � } | r�t | � } t j | j | f t | � � } n | j j | j
| j | j | j | j | j | j | j | j f k r$t | � } n | | _ | S( Nu negationu anchorc S s g | ] } | j � � q S( ( u clone( u .0u n( ( u>