def is_scalar(a) -> bool:
    """
    Tests if a python object is a scalar (instead of an array)

    Parameters
    ----------
    a : object
        Any object to be checked

    Returns
    -------
    bool
        Whether the input object is a scalar
    """
    if isinstance(a, (list, tuple)):
        return False
    if hasattr(a, "__array__") and hasattr(a, "__len__"):  # np.array(1) is scalar
        return False
    return True