Jeremy> I'd put this at the module level:
Jeremy> compiled_re_type = type(re.compile(""))
Jeremy> Then you can use isistance() to test:
Jeremy> isinstance(re.compile("spam+"), compiled_re_type)
But is it guaranteed that re.compile will always yield
an object of the same type?