[Python-Dev] type categories -- an example

Fredrik Lundh fredrik@pythonware.com
Tue, 20 Aug 2002 12:17:42 +0200


brett wrote:

> This might be a stupid question, but why wouldn't
> isinstance(re.compile("spam+"), type(re.compile('')))
> always work.

re.compile is a factory function, and it might (in theory) return
different types for different kind of patterns.

</F>