Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_operator.cpython-35.opt-2.pyc



]
@sgddlZddlmZddlmZmZmZmZddZGdddej	Z
dS)N)
fixer_base)CallNameStringtouch_importcsfdd}|S)Ncs
|_|S)N)
invocation)f)s1/opt/alt/python35/lib64/python3.5/fix_operator.pydecs	zinvocation.<locals>.decr
)r	rr
)r	rrsrc@seZdZdZdZdZdZdededeZdd	Z	e
d
ddZe
d
ddZe
dddZ
e
dddZe
dddZe
dddZe
dddZdd Zd!d"Zd#d$Zd%S)&FixOperatorTprez
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              z'(' obj=any ')'z
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              methodsobjcCs/|j||}|dk	r+|||SdS)N)
_check_method)selfnoderesultsmethodr
r
r	transform+szFixOperator.transformzoperator.contains(%s)cCs|j||dS)Ncontains)_handle_rename)rrrr
r
r_sequenceIncludes0szFixOperator._sequenceIncludeszhasattr(%s, '__call__')cCsG|d}|jtdtdg}ttd|d|jS)Nrz, z
'__call__'hasattrprefix)clonerrrr)rrrrargsr
r
r_isCallable4s
!zFixOperator._isCallablezoperator.mul(%s)cCs|j||dS)Nmul)r)rrrr
r
r_repeat:szFixOperator._repeatzoperator.imul(%s)cCs|j||dS)Nimul)r)rrrr
r
r_irepeat>szFixOperator._irepeatz$isinstance(%s, collections.Sequence)cCs|j||ddS)NcollectionsSequence)_handle_type2abc)rrrr
r
r_isSequenceTypeBszFixOperator._isSequenceTypez#isinstance(%s, collections.Mapping)cCs|j||ddS)Nr#Mapping)r%)rrrr
r
r_isMappingTypeFszFixOperator._isMappingTypezisinstance(%s, numbers.Number)cCs|j||ddS)NZnumbersNumber)r%)rrrr
r
r
_isNumberTypeJszFixOperator._isNumberTypecCs%|dd}||_|jdS)Nrr)valueZchanged)rrrnamerr
r
rrNs	zFixOperator._handle_renamecCsatd|||d}|jtddj||gg}ttd|d|jS)Nrz, .
isinstancer)rrrjoinrrr)rrrmoduleabcrrr
r
rr%Ss
+zFixOperator._handle_type2abccCsxt|d|ddj}t|tjrtd|kr@|St|df}|j|}|j|d|dS)N_rrr0rzYou should use '%s' here.)getattrr+r.r#Callablestrrwarning)rrrrsubZinvocation_strr
r
rrYs
zFixOperator._check_methodN)__name__
__module____qualname__Z
BM_compatibleorderrrdictZPATTERNrrrrr r"r&r(r*rr%rr
r
r
rr
s r
)r#Zlib2to3rZlib2to3.fixer_utilrrrrrZBaseFixr
r
r
r
r<module>s"
Back to Directory File Manager