Your IP : 18.227.13.119


Current Path : /opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/fix_operator.cpython-33.pyo

�
��f�
c@smdZddlZddlmZddlmZmZmZmZdd�Z	Gdd�dej
�ZdS(	u�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)
iN(u
fixer_base(uCalluNameuStringutouch_importcs�fdd�}|S(Ncs
�|_|S(N(u
invocation(uf(us(u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyudecs	uinvocation.<locals>.dec((usudec((usu?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu
invocationsu
invocationcBs|EeZdZd%ZdZdZdZdedede�Z	dd�Z
ed	�d
d��Zed�d
d��Z
ed�dd��Zed�dd��Zed�dd��Zed�dd��Zed�dd��Zdd�Zd d!�Zd"d#�Zd$S(&uFixOperatorupreu�
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              u'(' obj=any ')'u�
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              umethodsuobjcCs/|j||�}|dk	r+|||�SdS(N(u
_check_methoduNone(uselfunodeuresultsumethod((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu	transform+suFixOperator.transformuoperator.contains(%s)cCs|j||d�S(Nucontains(u_handle_rename(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_sequenceIncludes0suFixOperator._sequenceIncludesuhasattr(%s, '__call__')cCsG|d}|j�td�td�g}ttd�|d|j�S(Nuobju, u
'__call__'uhasattruprefix(ucloneuStringuCalluNameuprefix(uselfunodeuresultsuobjuargs((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_isCallable4s
!uFixOperator._isCallableuoperator.mul(%s)cCs|j||d�S(Numul(u_handle_rename(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_repeat:suFixOperator._repeatuoperator.imul(%s)cCs|j||d�S(Nuimul(u_handle_rename(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_irepeat>suFixOperator._irepeatu$isinstance(%s, collections.Sequence)cCs|j||dd�S(NucollectionsuSequence(u_handle_type2abc(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_isSequenceTypeBsuFixOperator._isSequenceTypeu#isinstance(%s, collections.Mapping)cCs|j||dd�S(NucollectionsuMapping(u_handle_type2abc(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_isMappingTypeFsuFixOperator._isMappingTypeuisinstance(%s, numbers.Number)cCs|j||dd�S(NunumbersuNumber(u_handle_type2abc(uselfunodeuresults((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu
_isNumberTypeJsuFixOperator._isNumberTypecCs%|dd}||_|j�dS(Numethodi(uvalueuchanged(uselfunodeuresultsunameumethod((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_handle_renameNs	uFixOperator._handle_renamecCsatd||�|d}|j�tddj||g��g}ttd�|d|j�S(Nuobju, u.u
isinstanceuprefix(utouch_importuNoneucloneuStringujoinuCalluNameuprefix(uselfunodeuresultsumoduleuabcuobjuargs((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu_handle_type2abcSs
+uFixOperator._handle_type2abccCs{t|d|ddj�}t|tj�rwd|kr@|St|d�f}|j|}|j|d|�ndS(Nu_umethodiumoduleuobjuYou should use '%s' here.(	ugetattruvalueu
isinstanceucollectionsuCallableustru
invocationuwarninguNone(uselfunodeuresultsumethodusubuinvocation_str((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu
_check_methodYs
uFixOperator._check_methodNT(u__name__u
__module__u__qualname__uTrueu
BM_compatibleuorderumethodsuobjudictuPATTERNu	transformu
invocationu_sequenceIncludesu_isCallableu_repeatu_irepeatu_isSequenceTypeu_isMappingTypeu
_isNumberTypeu_handle_renameu_handle_type2abcu
_check_method(u
__locals__((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyuFixOperators uFixOperator(u__doc__ucollectionsulib2to3u
fixer_baseulib2to3.fixer_utiluCalluNameuStringutouch_importu
invocationuBaseFixuFixOperator(((u?/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_operator.pyu<module>
s
"

?>