def to_list(x, default=None):
 if (x is None):
  return default
 if (not isinstance(x, (list, tuple))):
  return [x]
 else:
  return x

def to_list ( x , default = None ) : if ( x is None ) : return default if ( not isinstance ( x , ( list , tuple ) ) ) : return [ x ] else : return x
converts an arbitrary object c{obj} to a c{list} .