def _if_str_then_list(listing):
 if (type(listing) is str):
  return [listing]
 elif (type(listing) is not list):
  raise TypeError
 return listing

def _if_str_then_list ( listing ) : if ( type ( listing ) is str ) : return [ listing ] elif ( type ( listing ) is not list ) : raise TypeError return listing
checks if its argument is a list or a str .