[Twisted-Python] zope.interface

Jared Gisin jared.gisin at isilon.com
Tue Dec 15 13:11:03 EST 2009

I completely fail to see why zope.interface is even needed. It's not Pythonic at all and it contributes to unnecessary code bloat.

What's wrong with writing subclasses? I've never had a case where that wasn't sufficient. Instead of filling up your files with all of  these empty class definitions that define the methods that objects should implemmnt, why not just make the base object from which all similar object inherit implement the required methods, and if it's up to a subclass to provide functionality, just raise an ImplementationError in the base class method and let it be a run-time error. Keep it clean and simple and let Python do its work.

-----Original Message-----
From: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-bounces at twistedmatrix.com] On Behalf Of Andrew Bennetts
Sent: Monday, December 14, 2009 5:21 PM
To: Twisted general discussion
Subject: Re: [Twisted-Python] zope.interface

Tim Allen wrote:
> It occurs to me that recent discussions about splitting Deferreds off
> into their own library might consider zope.interface as a model. Has it
> prospered, as separate library? Does anyone besides Zope and Twisted use
> it? I don't know, but it might be worth finding out.

I'm not sure that it has “prospered” exactly, but a Python 3 added its
Abstract Base Classes feature[1] to satisfy some (many?) of the same needs.
So in some sense the general idea has prospered, even if this particular
implementation hasn't taken over the world.


[1] http://docs.python.org/dev/3.0/whatsnew/2.6.html#pep-3119

Twisted-Python mailing list
Twisted-Python at twistedmatrix.com

More information about the Twisted-Python mailing list