Back to index

python3.2  3.2.2
Classes | Functions
lib2to3.fixes.fix_operator Namespace Reference

Classes

class  FixOperator

Functions

def invocation

Detailed Description

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)

Function Documentation

Definition at line 19 of file fix_operator.py.

00019 
00020 def invocation(s):
00021     def dec(f):
00022         f.invocation = s
00023         return f
00024     return dec
00025 

Here is the caller graph for this function: