def validate_float(s):
 try:
  return float(s)
 except ValueError:
  raise ValueError((u'Could not convert "%s" to float' % s))

def validate_float ( s ) : try : return float ( s ) except ValueError : raise ValueError ( ( u'Could not convert "%s" to float' % s ) )
convert s to float or raise .