[Python-Dev] type categories -- an example

Andrew Koenig ark@research.att.com
19 Aug 2002 18:45:39 -0400


Jeremy> Hard to say.  I can read the code and see that the current
Jeremy> implementation will always return objects of the same type.
Jeremy> In fact, it's using type(sre_compile.compile("", 0))
Jeremy> internally to represent that type.

Jeremy> That's not a guarantee.  Perhaps Fredrik wants to reserve the
Jeremy> right to change this in the future.  It's not unusual for
Jeremy> Python modules to be under-specified in this way.

The real point is that this is an example of why a uniform way
of checking for such types would be nice.  I shouldn't have
to read the source to figure out how to tell if something is
a compiled regular expression.


-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark