[Zope3-dev] interface package changes

Martijn Faassen faassen at infrae.com
Fri May 7 16:57:10 EDT 2004


Gary Poster wrote:
> 
> 
> Martijn Faassen wrote:
> 
>> Definitely agreed it should work on ExtensionClass, as I want to use 
>> it in a Zope 2.7 context. :)
> 
> :-)
> 
>> I'll do some tests in Zope 7 with Silva soon (switching it over to use 
>> Zope 3 interfaces experimentally).
>  
> Dang, if you have Zope 7, what do you need Zope 3 for? ;-)

I can report success (see below), so that means we can start applying 
chunks of Zope 3 inside Zope 2.7. The only thing necessary to get it 
going is by adding a little path directive in your zope config file 
pointing to a Zope3 src directory.

>> If this ExtensionClass compatibility code is unrelated to the 
>> backwards compatibility code which handles an explicit __implements__ 
>> (like in Zope 2 interfaces) then I hope we can get rid of that. If not 
>> and the implements() hackery doesn't work on ExtensionClass, I'll have 
>> to do some more research on how to proceed. I did some experiments in 
>> the past and I *think* I had implements() working in Zope 2, but I'll 
>> do another experiment. 
> 
> Please do (and let us know how it turns out), but I think you're right.

I can Zope 3 interfaces in Zope 2 in Silva now (using the 
faassen-interfaces-branch). I have a Silva version that uses Zope 3 
interfaces throughout, and it seems to work just fine in my first 
testing. I get tons of DeprecationWarnings but those are easily fixed by 
starting to use providedBy instead of isImplementedBy and the like.

So this looks like there is no obstacle to starting to use adapters and 
the like on the Python level in Zope 2.7. We can start hollowing out 
Zope 2 applications from the inside and replacing them with shiny new 
Zope3-ish interiors now.

Does this mean we can start ripping out the __implements__ backwards 
compatibility facilities from zope.interface? (keeping in the 
ExtensionClass stuff of course)

> If all else fails we might be able to slam Zope 3 stuff in 
> __implemented__ directly, but that would be pretty unfortunate to lose 
> the protection of the indirection.
> 
> The Zope 2 webdav interface is the only thing I remember needing in the 
> __implements__ bag, and that should be easy enough.

It's certainly possible to still use the __implements__ bag. You can use 
them together with implements() in a Zope 2 application if you really 
have to.

Regards,

Martijn



More information about the Zope3-dev mailing list