On Wed, Dec 31, 2003 at 01:16:22PM -0800, Raymond Hettinger wrote: > The category of Fastest Code is much less vague but tends towards > using fancy tricks: > > def ishexstring(s): > try: > int(s, 16) > except ValueError: > return False > return True >>> ishexstring("0xff") True ... but probably it doesn't fit the OP's definition Jeff