Files
python-troveclient/reddwarfclient/base.py
Ed Cranford 01313e56fe PEP8 fixes
2012-05-03 16:20:39 -05:00

15 lines
297 B
Python

def isid(obj):
"""
Returns true if the given object can be converted to an ID,
false otherwise.
"""
if hasattr(obj, "id"):
return True
else:
try:
int(obj)
except ValueError:
return False
else:
return True