- A+
-
operator.abs(a):取a的绝对值
-
operator.add(a,b):相当于a+b
-
operator.sub(a,b):相当于a-b
-
operator.mul(a,b):相当于a*b
-
operator.floordiv(a,b):相当于a /b,结果为int类型
-
operator.truediv(a,b):相当于a /b,结果为float类型
-
operator.pow(a,b):相当于a**b
-
operator.mod(a,b):相当于a%b
-
operator.gt(a,b):相当于 a>b
-
operator.rshift(a,b):相当于 a>>b
-
operator.lshift(a,b):相当于a<<b
-
operator.concat(seq1,seq2):相当于seq1+seq2
-
operator.contains(seq,b):相当于 b in seq ,返回结果为布尔值
-
operator.countOf(a,b):返回b在a中出现的次数
-
operator.eq(a,b):相当于 a==b
-
operator.xor(a,b):相当于a ^ b
-
operator.xor(a,b):相当于 a ^ b
-
operator.iadd(a,b):相当于a+=b
-
operator.isub(a,b):相当于a-=b
-
operator.imul(a,b):相当于a*=b
-
operator.ifloordiv(a,b):相当于a /=b,结果为int类型
-
operator.itruediv(a,b):相当于a /=b,结果为float类型
-
operator.imod(a,b):相当于a%=b
-
operator.iand(a,b):相当于a&=b
-
operator.ipow(a,b):相当于a **= b
-
operator.iconcat(seq1,seq2):相当于seq1+=seq2
-
operator.ifloordiv(a,b):相当于a // =b
-
operator.ilshift(a,b):相当于 a<<=b
-
operator.ior(a,b):相当于a |= b
-
operator.irshift(a,b):相当于 a>>=b
-
operator.ixor(a,b):相当于a ^= b
-
operator.getitem(a,b):相当于 a[b]
-
operator.setitem(a,b,c):设置a中索引值为b的项目值更改为c,即a[b]=c
-
operator.delitem(a,b):相当于del a[b]
-
operator.repeat(seq,n):相当于 seq*n
-
operator.indexOf(a,b):返回b在a中首次出现位置的索引值
-
operator.inv(a):相当于~a
-
operator.invert(a):相当于~a
-
operator.is_(a,b):相当于 a is b
-
operator.is_not(a,b):相当于 a is not b
-
operator.truth(a):判断a是否为真,如果为真,返回true,反之返回false
-
operator.ge(a,b):相当于 a>=b
-
operator.le(a,b):相当于 a<=b
-
operator.lt(a,b):相当于 a<b
-
operator.ne(a,b):相当于a != b
-
operator.neg(a):相当于-a
-
operator.pos(a):相当于+a
-
operator.not_(a):相当于 not a
-
operator.or_(a):相当于 a | b
如下几个是不太确定的,知道的朋友留言共享哈,谢谢~
-
operator.length_hint(obj,default):
-
operator.matmul(a,b):
-
operator.imatmul(a,b):
-
operator.methodcaller:
-
operator.attrgetter(*attrs):
-
operator.itemgetter(item):