[Zope3-Users] Dynamic Typing: Are checks on interface compliance
possible?
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu May 18 09:09:46 EDT 2006
On Thursday 18 May 2006 02:29, Michael Howitz wrote:
> Reinhold Strobl wrote:
> > Hi,
> >
> > what I am looking for is something like PyChecker for Zope interfaces. I
> > mean PyChecker aims to address the benefit of static typed languages and
> > their compile-time checkings.
> >
> > In Zope, there is no forced interface compliance. But is there a
> > possibility or program, which can check this?
>
> Hi,
>
> you should have a look at zope.interface.verify. With verifyClass and
> verifyObject you can check the interface compliance for classes and
> objects.
In addition there is the FieldProperty class, which can be used to enforce a
value. I have recently started to use it all the time. I really like it too.
Eventually you probably would also want something that enforces the entire
interface on the class, including invariants. That would be something
interesting to think about.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-users
mailing list