[Zope3-dev] Re: Interface declaration API
Guido van Rossum
guido@python.org
Fri, 14 Mar 2003 13:22:34 -0500
> Guido van Rossum <guido@python.org> wrote:
>
> >Um, forget that mail. I had decided not to send it, and hit the wrong
> >button. :-(
>
> Good. Because the example you gave would certainly surprise me
> if that's the way it worked.
>
> --RDM
Really? Yet I believe this was the intent of Jim's mutable interface
specifications. Here's my example again:
x = implementedBy(Foo)
print IBar in x # False
addImplements(Foo, IBar)
print IBar in x # True
x is the interface spec for class Foo.
At the first print statement, Foo doesn't implement IBar, so x doesn't
contain IBar. At the second print statement, Foo does implement IBar,
so x (which still is the interface specification object that describes
all Foo's interfaces) does contain IBar. At least that's how I
understand Jim's proposal of a few days ago -- it may have evolved
since then, I'm behind in catching up on that discussion (which in
part was taken off-line to a smaller audience).
--Guido van Rossum (home page: http://www.python.org/~guido/)