[Python-Dev] type categories
Martin v. Loewis
15 Aug 2002 00:45:43 +0200
Andrew Koenig <firstname.lastname@example.org> writes:
> Martijn> But isn't that exactly what interfaces are?
> Not really. I can see how an interface can claim that a particular
> method exists, but not how it can claim that the method implements a
> function that is antisymmetric and transitive.
An interface can certainly claim such things, in its documentation -
and indeed, the documentation of interfaces typically associates
certain semantics with the objects implementing the interface (and in
some cases, even semantics for objects using the interface).
Of course, there is typically no way to automatically *validate* such
claims; you can only validate conformance to signatures. It turns out
that, in Python, you cannot even do that.