def is_iterable(val):
    """
    Checks if `val` is iterable.


    This method calls `iter(val)`. If an exception is raised, it's not an iterable. 

    This is the 'correct' way, to account for the mess types are in Python.

    For details, see https://stackoverflow.com/a/1952655
    """
    try:
        iter(val)
    except TypeError:
        return False
    return True