def _tuple(thing):
    """Turn something into a tuple; everything but tuple and list is turned into a one-element tuple
    containing that thing.
    """
    if isinstance(thing, tuple) and not hasattr(thing, "_fields"):  # exclude namedtuples
        return thing
    elif isinstance(thing, list):
        return tuple(thing)
    else:
        return thing,