[Zope3-dev] interface implementation errors
Jim Fulton
jim@zope.com
Fri, 08 Nov 2002 10:37:42 -0500
Steve Alexander wrote:
> 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?
No, but there should be.
> Or, perhaps we should have an IPersistent without this method, but an
> IPersistentIndependent (or somesuch name) that extends IPersistent with
> this method.
That would be a better solution in this case I think.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (888) 344-4332 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org