A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-August/028073.html below:

[Python-Dev] type categories -- an example

[Python-Dev] type categories -- an example [Python-Dev] type categories -- an exampleAndrew Koenig ark@research.att.com
20 Aug 2002 10:24:37 -0400
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



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4