[Zope] Defining constants for an Interface in a Zope2 product.

Marco Bizzarri marco.bizzarri at gmail.com
Fri Apr 28 10:14:32 EDT 2006


Hi all.

I would like to be able to define an interface which specifies both methods
and constants, something like this:

class IMyTest(Interface):
       A = Constant(1)
       B = Constant(2)
       C = Constant(3)

       def aMethod(self, a_value):
            """ something """

A, B and C could be any meaningful constant for this interface, like
possible return values for the aMethod. Then I could possibly test any class
using and object which implements this simply by testing it against the
IMyTest and if the return values are IMyTest.A, IMyTest.B, IMyTest.C.

Is this possible in some way?

Regards
Marco


--
Marco Bizzarri
http://notenotturne.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060428/007f15dc/attachment.htm


More information about the Zope mailing list