
Jeremy> Then you asked if re.compile() was guaranteed to return an Jeremy> object of the same type. That question is all about the Jeremy> contract of the re module. The answer might have been: "No. Jeremy> In version X, it happens to always return objects of the same Jeremy> type, but in version Z, I may want to change this." Jeremy> I suppose we could get at the general question of checking Jeremy> types by assuming that re.compile() returned instances of two Jeremy> apparently unrelated classes and that we wanted a way to Jeremy> declare their relationship. I'm thinking of something like Jeremy> Haskell typeclasses here. Right. And the classes don't even have to be unrelated -- it's enough that neither one is derived from the other (for instance, that they both be derived from a third class). -- Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark