def _check_should_use_weak_scalar(key: tuple[str | type, ...]) -> bool:
    """Helper function for promotion, where we need to check whether we
    should use weak promotion for python floats/integers (NEP 50/NumPy 2).
    """
    max_scalar_kind = -1
    max_array_kind = -1

    for in_t in key:
        if isinstance(in_t, str):
            kind = _get_kind_score(np.dtype(in_t).type)
            max_array_kind = max(max_array_kind, kind)
        else:
            kind = _get_kind_score(in_t)
            max_scalar_kind = max(max_scalar_kind, kind)

    all_scalars_or_arrays = max_scalar_kind == -1 or max_array_kind == -1
    return not all_scalars_or_arrays and max_array_kind >= max_scalar_kind
Helper function for promotion, where we need to check whether we
    should use weak promotion for python floats/integers (NEP 50/NumPy 2).
    
cupynumeric/_ufunc/ufunc.py