Viewing File: /opt/alt/python-internal/lib64/python3.11/lib2to3/fixes/__pycache__/fix_operator.cpython-311.pyc



!A?hb
bdZddlZddlmZddlmZmZmZm	Z	dZ
GddejZdS)aFixer for operator functions.

operator.isCallable(obj)       -> callable(obj)
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj)   -> isinstance(obj, collections.abc.Sequence)
operator.isMappingType(obj)    -> isinstance(obj, collections.abc.Mapping)
operator.isNumberType(obj)     -> isinstance(obj, numbers.Number)
operator.repeat(obj, n)        -> operator.mul(obj, n)
operator.irepeat(obj, n)       -> operator.imul(obj, n)
N)
fixer_base)CallNameStringtouch_importcfd}|S)Nc|_|SN)
invocation)fss G/opt/alt/python-internal/lib64/python3.11/lib2to3/fixes/fix_operator.pydeczinvocation.<locals>.decs)r
rs` rrrs#JrcneZdZdZdZdZdZdeeezZdZ	e
dd	Ze
d
dZe
dd
Z
e
ddZe
ddZe
ddZe
ddZdZdZdZdS)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 > >
              )methodsobjcN|||}||||SdSr
)
_check_method)selfnoderesultsmethods    r	transformzFixOperator.transform+s7##D'226$(((rzoperator.contains(%s)c0|||dS)Ncontains_handle_renamerrrs   r_sequenceIncludeszFixOperator._sequenceIncludes0s""4*===rzcallable(%s)c|d}ttd|g|jS)Nrcallableprefix)rrcloner')rrrrs    r_isCallablezFixOperator._isCallable4s4enD$$syy{{mDKHHHHrzoperator.mul(%s)c0|||dS)Nmulr r"s   r_repeatzFixOperator._repeat9s""4%888rzoperator.imul(%s)c0|||dS)Nimulr r"s   r_irepeatzFixOperator._irepeat=s""4&999rz(isinstance(%s, collections.abc.Sequence)c2|||ddS)Ncollections.abcSequence_handle_type2abcr"s   r_isSequenceTypezFixOperator._isSequenceTypeAs$$T74EzRRRrz'isinstance(%s, collections.abc.Mapping)c2|||ddS)Nr1Mappingr3r"s   r_isMappingTypezFixOperator._isMappingTypeEs$$T74EyQQQrzisinstance(%s, numbers.Number)c2|||ddS)NnumbersNumberr3r"s   r
_isNumberTypezFixOperator._isNumberTypeIs$$T7IxHHHrcX|dd}||_|dS)Nrr)valuechanged)rrrnamers     rr!zFixOperator._handle_renameMs."1%rctd|||d}|tdd||gzg}t	td||jS)Nrz, .
isinstancer&)rr(rjoinrrr')rrrmoduleabcrargss       rr4zFixOperator._handle_type2abcRskT64(((en		VD388VSM+B+B$BCCDD&&T[AAAArc
t|d|ddjz}t|tjjr?d|vr|St
|df}|j|z}||d|zdS)N_rrrErzYou should use '%s' here.)	getattrr>rCcollectionsrFCallablestrrwarning)rrrrsubinvocation_strs      rrzFixOperator._check_methodXssWX%6q%9%??@@fko677	Q7""
75>**,!'!2S!8T#>#OPPPtrN)__name__
__module____qualname__
BM_compatibleorderrrdictPATTERNrrr#r)r,r/r5r8r<r!r4rrrrrrsMEG
C
Dc2223G)))
Z'((>>)(>ZII IZ"##99$#9Z#$$::%$:Z:;;SS<;SZ9::RR;:RZ011II21I
BBB					rr)
__doc__collections.abcrKlib2to3rlib2to3.fixer_utilrrrrrBaseFixrrrr<module>r]s		????????????GGGGG*$GGGGGr
Back to Directory File Manager