try: f = float(someText) catch ValueError: # I just parsed you, this is crazy, # here's an exception, throw it maybe?