def type_is_namedtuple(t) ->bool:
    """Figuring out if a type is a named tuple is not as trivial as one may expect"""
    try:
        return issubclass(t, tuple) and hasattr(t, '_fields')
    except TypeError:
        return False
