我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用operator.__div__()。
def __div__(self, rhs): return op_binary(self, rhs, operator.__div__)
def __rdiv__(self, lhs): return op_binary(lhs, self, operator.__div__)
def __idiv__(self, v): return self.op_binary_inplace(v, operator.__div__)
def triplet_to_fractional_rgb(rgbtuple): return map(operator.__div__, rgbtuple, _maxtuple)
def __mul__(self, other): with self._lock: return operator.__mul__(self.__wrapped__, other) # __div__ is py2 only
def __div__(self, other): # nopep8 with self._lock: return operator.__div__(self.__wrapped__, other)
def __rdiv__(self, other): # nopep8 with self._lock: return operator.__div__(other, self.__wrapped__)
def divide(typeA, typeB): return operator.__div__(typeA.number.getNum(), typeB.number.getNum())