def _set_to_None_if_empty(x):
    """
    Helper function to clean up arguments: Returns None if x==None or
    x is an empty container.

    EXAMPLES::

        sage: import sage.geometry.polyhedron.misc as P
        sage: None == P._set_to_None_if_empty([])
        True
        sage: P._set_to_None_if_empty([1])
        [1]
    """
    if x is None: return x
    x = list(x)
    if len(x)==0: return None
    return x