Files
PowerToys/PythonHome/Lib/lib2to3/fixes/fix_operator.pyc

37 lines
4.8 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s^dZddlmZddlmZmZmZmZd<00>Zdej fd<00><00>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<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(t
fixer_base(tCalltNametStringt touch_importcs<00>fd<00>}|S(Ncs <00>|_|S(N(t
invocation(tf(ts(s#.\Lib\lib2to3\fixes\fix_operator.pytdecs ((RR((Rs#.\Lib\lib2to3\fixes\fix_operator.pyRst FixOperatorcBs<>eZeZdZdZdZdedede<00>Zd<00>Z e
d<00>d<00><00>Z e
d <00>d
<00><00>Z e
d <00>d <00><00>Z e
d <00>d<00><00>Ze
d<00>d<00><00>Ze
d<00>d<00><00>Ze
d<00>d<00><00>Zd<00>Zd<00>Zd<00>ZRS(tpres<65>
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||<00>}|dk r+|||<00>SdS(N(t _check_methodtNone(tselftnodetresultstmethod((s#.\Lib\lib2to3\fixes\fix_operator.pyt transform)s soperator.contains(%s)cCs|j||d<00>S(Nucontains(t_handle_rename(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt_sequenceIncludes.sshasattr(%s, '__call__')cCsG|d}|j<00>td<00>td<00>g}ttd<00>|d|j<00>S(NR u, u
'__call__'uhasattrtprefix(tcloneRRRR(RRRR targs((s#.\Lib\lib2to3\fixes\fix_operator.pyt _isCallable2s
!soperator.mul(%s)cCs|j||d<00>S(Numul(R(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt_repeat8ssoperator.imul(%s)cCs|j||d<00>S(Nuimul(R(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt_irepeat<ss$isinstance(%s, collections.Sequence)cCs|j||dd<00>S(Nu collectionsuSequence(t_handle_type2abc(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt_isSequenceType@ss#isinstance(%s, collections.Mapping)cCs|j||dd<00>S(Nu collectionsuMapping(R(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt_isMappingTypeDssisinstance(%s, numbers.Number)cCs|j||dd<00>S(NunumbersuNumber(R(RRR((s#.\Lib\lib2to3\fixes\fix_operator.pyt _isNumberTypeHscCs%|dd}||_|j<00>dS(NRi(tvaluetchanged(RRRtnameR((s#.\Lib\lib2to3\fixes\fix_operator.pyRLs cCsatd||<00>|d}|j<00>tddj||g<00><17>g}ttd<00>|d|j<00>S(NR u, u.u
isinstanceR(RRRRtjoinRRR(RRRtmoduletabcR R((s#.\Lib\lib2to3\fixes\fix_operator.pyRQs
+cCs<>t|d|ddjjd<00><17>}t|<00>r<>d|krC|St|d<19>f}t|j<00>|}|j|d|<16>ndS(Nt_RitasciiR$R uYou should use '%s' here.(tgetattrR tencodetcallabletunicodeRtwarningR(RRRRtsubtinvocation_str((s#.\Lib\lib2to3\fixes\fix_operator.pyR Ws'  (t__name__t
__module__tTruet BM_compatibletorderR R tdicttPATTERNRRRRRRRRRRRR (((s#.\Lib\lib2to3\fixes\fix_operator.pyR s    N( t__doc__tlib2to3Rtlib2to3.fixer_utilRRRRRtBaseFixR (((s#.\Lib\lib2to3\fixes\fix_operator.pyt<module>
s"