Ejemplo n.º 1
0
def promote_scalars(a, b):
    """Promote two CTypes"""
    return CType.from_numpy_dtype(np.result_type(to_numpy(a), to_numpy(b)))
Ejemplo n.º 2
0
def promote_scalars(a, b):
    """Promote two CTypes"""
    try:
        return CType.from_numpy_dtype(np.result_type(to_numpy(a), to_numpy(b)))
    except TypeError, e:
        raise TypeError("Cannot promote %s and %s: %s" % (a, b, e))