ó p”þfc@s^dZddlmZddlmZmZmZmZd„Zdej fd„ƒYZ dS(sÓFixer for operator functions. operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType(obj) -> isinstance(obj, numbers.Number) operator.repeat(obj, n) -> operator.mul(obj, n) operator.irepeat(obj, n) -> operator.imul(obj, n) iÿÿÿÿ(t fixer_base(tCalltNametStringt touch_importcs‡fd†}|S(Ncs ˆ|_|S(N(t invocation(tf(ts(s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pytdecs ((RR((Rs2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyRst FixOperatorcBsðeZeZdZdZdZdededeƒZd„Z e dƒd„ƒZ e d ƒd „ƒZ e d ƒd „ƒZ e d ƒd„ƒZe dƒd„ƒZe dƒd„ƒZe dƒd„ƒZd„Zd„Zd„ZRS(tpresµ method=('isCallable'|'sequenceIncludes' |'isSequenceType'|'isMappingType'|'isNumberType' |'repeat'|'irepeat') s'(' obj=any ')'s¼ power< module='operator' trailer< '.' %(methods)s > trailer< %(obj)s > > | power< %(methods)s trailer< %(obj)s > > tmethodstobjcCs/|j||ƒ}|dk r+|||ƒSdS(N(t _check_methodtNone(tselftnodetresultstmethod((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt transform)s soperator.contains(%s)cCs|j||dƒS(Nucontains(t_handle_rename(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt_sequenceIncludes.sshasattr(%s, '__call__')cCsG|d}|jƒtdƒtdƒg}ttdƒ|d|jƒS(NR u, u '__call__'uhasattrtprefix(tcloneRRRR(RRRR targs((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt _isCallable2s !soperator.mul(%s)cCs|j||dƒS(Numul(R(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt_repeat8ssoperator.imul(%s)cCs|j||dƒS(Nuimul(R(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt_irepeat<ss$isinstance(%s, collections.Sequence)cCs|j||ddƒS(Nu collectionsuSequence(t_handle_type2abc(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt_isSequenceType@ss#isinstance(%s, collections.Mapping)cCs|j||ddƒS(Nu collectionsuMapping(R(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt_isMappingTypeDssisinstance(%s, numbers.Number)cCs|j||ddƒS(NunumbersuNumber(R(RRR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt _isNumberTypeHscCs%|dd}||_|jƒdS(NRi(tvaluetchanged(RRRtnameR((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyRLs cCsatd||ƒ|d}|jƒtddj||gƒƒg}ttdƒ|d|jƒS(NR u, u.u isinstanceR(RRRRtjoinRRR(RRRtmoduletabcR R((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyRQs +cCs„t|d|ddjjdƒƒ}t|ƒr€d|krC|St|dƒf}t|jƒ|}|j|d|ƒndS(Nt_RitasciiR$R uYou should use '%s' here.(tgetattrR tencodetcallabletunicodeRtwarningR(RRRRtsubtinvocation_str((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyR Ws'  (t__name__t __module__tTruet BM_compatibletorderR R tdicttPATTERNRRRRRRRRRRRR (((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyR s    N( t__doc__tlib2to3Rtlib2to3.fixer_utilRRRRRtBaseFixR (((s2/usr/lib64/python2.7/lib2to3/fixes/fix_operator.pyt s"