python类__mul__()的实例源码

Array.py 文件源码 项目:pynapl 作者: marinuso 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def flatten_idx(self, idx, IO=0):
        return sum((x-IO)*(y-IO) for x,y in zip(scan_reverse(operator.__mul__,self.rho[1:]+[1]), idx))
Util.py 文件源码 项目:pynapl 作者: marinuso 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def product(seq):
    """The product of a sequence of numbers"""
    return reduce(operator.__mul__, seq, 1)
native_int.py 文件源码 项目:ntypes 作者: AlexAltea 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def __mul__(self, rhs):
        return op_binary(self, rhs, operator.__mul__)
native_int.py 文件源码 项目:ntypes 作者: AlexAltea 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def __rmul__(self, lhs):
        return op_binary(lhs, self, operator.__mul__)
native_int.py 文件源码 项目:ntypes 作者: AlexAltea 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def __imul__(self, v):
        return self.op_binary_inplace(v, operator.__mul__)
native_float.py 文件源码 项目:ntypes 作者: AlexAltea 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def __mul__(self, rhs):
        return op_binary(self, rhs, operator.__mul__)
native_float.py 文件源码 项目:ntypes 作者: AlexAltea 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __rmul__(self, lhs):
        return op_binary(lhs, self, operator.__mul__)
thread_tools.py 文件源码 项目:cpy2py 作者: maxfischer2781 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def __mul__(self, other):
        with self._lock:
            return operator.__mul__(self.__wrapped__, other)

    # __div__ is py2 only
thread_tools.py 文件源码 项目:cpy2py 作者: maxfischer2781 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def __rmul__(self, other):
        with self._lock:
            return operator.__mul__(other, self.__wrapped__)
your-ride-is-here.py 文件源码 项目:Leetcode 作者: staticor 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def ride(group,comet):
    from operator import __mul__
    from functools import reduce
    kk = [ord(i) - ord('A') + 1 for i in group.upper()]
    ll = [ord(i) - ord('A') + 1 for i in comet.upper()]
    group = reduce(__mul__, kk)
    comet = reduce(__mul__, ll)
    return 'GO' if group % 47 == comet % 47 else 'STAY'
multiply.py 文件源码 项目:enterprise-fibonacci 作者: surrsurus 项目源码 文件源码 阅读 59 收藏 0 点赞 0 评论 0
def multiply(typeA, typeB):
    return operator.__mul__(typeA.number.getNum(), typeB.number.getNum())
your-ride-is-here.py 文件源码 项目:codewars_python 作者: staticor 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def ride(group,comet):
    from operator import __mul__
    from functools import reduce
    kk = [ord(i) - ord('A') + 1 for i in group.upper()]
    ll = [ord(i) - ord('A') + 1 for i in comet.upper()]
    group = reduce(__mul__, kk)
    comet = reduce(__mul__, ll)
    return 'GO' if group % 47 == comet % 47 else 'STAY'


问题


面经


文章

微信
公众号

扫码关注公众号