def _totuple(x):
 if isinstance(x, basestring):
  out = (x,)
 elif isinstance(x, (int, float)):
  out = (str(x),)
 elif (x is None):
  out = (None,)
 else:
  out = tuple(x)
 return out

def _totuple ( x ) : if isinstance ( x , basestring ) : out = ( x , ) elif isinstance ( x , ( int , float ) ) : out = ( str ( x ) , ) elif ( x is None ) : out = ( None , ) else : out = tuple ( x ) return out
utility stuff to convert string .