[Zope3-dev] interface implementation errors

Steve Alexander steve@cat-box.net
Fri, 08 Nov 2002 12:24:54 +0000


kapil thangavelu wrote:

> i wrote up a script to check interface implementation for z3, its 
> attached
> along with the error results. the script tries to filter out the 
> errors that
> are caused from dynamic implementation of the interfaces.


The first error in the file is this:

Class <type 'Persistence.Persistent'>, From 
/home/ender/projects/Zope3/zope3-cvs/lib/python/Persistence/__init__.py
Asserts but does not implement
Interface <Interface Persistence.IPersistent.IPersistent at 8287a7c>
from 
/home/ender/projects/Zope3/zope3-cvs/lib/python/Persistence/IPersistent.py
with exception Interface.Exceptions.BrokenImplementation:

  An object has failed to implement interface <Interface 
Persistence.IPersistent.IPersistent at 8287a7c>

         The _p_independent attribute was not provided.


In the interface IPersistent.py, _p_independent is described as being an 
optional method that a persistent object type can define to return true 
if it wants to declare it isn't bothered about read conflicts.

Is there any mechanism in Interfaces / Schemas to describe that a method 
may be there, or may be not there?

Or, perhaps we should have an IPersistent without this method, but an 
IPersistentIndependent (or somesuch name) that extends IPersistent with 
this method.

--
Steve Alexander