[IPython-user] Interfaces (as in zope.interface) in IPython.kernel

Brian Granger ellisonbg.net@gmail....
Tue Oct 28 16:07:04 CDT 2008


Hi,

Currently, we use interfaces (as in zope.interface) heavily in
IPython.kernel.  There are a few reasons for this:

* It is how Twisted is setup to work, and we use Twisted.
* We used adaptation and zope.interface automates that.

There are a few downsides though:

* Everything is much more verbose as you have the interface and
implementation separately.
* Everything is much more verbose as you have the interface and
implementation separately.
* Zope.interface doesn't actually check that something implements a
given interface.  It is purely informal.
* Thus, is doesn't actually do very much other than allow us to adapt things.
* Verbosity means the code is less hackable and readable.
* Some parts of the code probably don't need interfaces, but those
parts still have to put up with zope.interface (Gael knows about this)
:-)

Because of Twisted, we will always have a zope.interface depenence.
But, my question is this:

Should we get rid of or reduce our usage if zope.interface?  We still
need the adapter registry that zope.interface has, so we can't
completely get rid of it, but we could reduce our interface to a
simple pass:

class IFoo(Interface):
    pass

Rather than have all of the methods and attributes declared too.  What
do people think about this.  I am especially interested to hear what
Min thinks.

Cheers

Brian



I am wondering if we want to continue to u


More information about the IPython-user mailing list