ACC SHELL

Path : /usr/lib/python/lib2to3/fixes/
File Upload :
Current File : //usr/lib/python/lib2to3/fixes/fix_has_key.pyc

Ñò
sÄMc@sidZddklZddklZddklZddklZlZdei	fd„ƒYZ
dS(	s&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(tpytree(ttoken(t
fixer_base(tNametparenthesizet	FixHasKeycBseZdZd„ZRS(s•
    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 ','>
                )
                ')'
            >
        >
    >
    cCsv|pt‚|i}|ii|ijo|ii|iƒodS|idƒ}|d}|i	}g}|dD]}||i
ƒqy~}	|di
ƒ}
|idƒ}|o+g}|D]}||i
ƒqÆ~}n|
i|i|i|i|i
|i|i|ifjot|
ƒ}
nt|	ƒdjo|	d}	nti|i|	ƒ}	d|	_	td	d
dƒ}
|o1tdd
dƒ}ti|i||
fƒ}
nti|i|
|
|	fƒ}|o2t|ƒ}ti|i|ft|ƒƒ}n|ii|i|i|i|i|i|i|i|i|if	jot|ƒ}n||_	|S(Ntnegationtanchortbeforetargtafteriiu uintprefixunot( tAssertionErrortsymstparentttypetnot_testtpatterntmatchtNonetgetRtclonet
comparisontand_testtor_testttesttlambdeftargumentRtlenRtNodetpowerRtcomp_opttupletexprtxor_exprtand_exprt
shift_exprt
arith_exprttermtfactor(tselftnodetresultsR
RRRt_[1]tnRR	R
t_[2]tn_optn_nottnew((s//usr/lib/python2.6/lib2to3/fixes/fix_has_key.pyt	transformGsF	
	++"	&	(t__name__t
__module__tPATTERNR1(((s//usr/lib/python2.6/lib2to3/fixes/fix_has_key.pyR'sN(t__doc__tRtpgen2RRt
fixer_utilRRtBaseFixR(((s//usr/lib/python2.6/lib2to3/fixes/fix_has_key.pyt<module>s


ACC SHELL 2018