Dan Bishop wrote:
Steven Bethard wrote:

Is there a good way to determine if an object is a numeric type?

How about this?

... def is_number(x):
...    try:
...       x + 1
...       return True
...    except TypeError:
...       return False

Great, thanks! That's the kind of thing I was looking for!

Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to