[Python-Dev] type categories -- an example

Andrew Koenig ark@research.att.com
Mon, 19 Aug 2002 18:25:45 -0400 (EDT)


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?