
I've been looking into adaption frameworks recently. I've found the following different frameworks: PEP 246 PyProtocols Zope3 Twisted Nevow.compy Can someone explain to me the differences between them, and why we have so many?

On Thu, Oct 14, 2004 at 09:29:50AM -0400, Peter Hunt wrote:
I've been looking into adaption frameworks recently. I've found the following different frameworks:
PEP 246 PyProtocols Zope3 Twisted Nevow.compy
Can someone explain to me the differences between them, and why we have so many?
The SVN version Twisted uses Zope 3's zope.interface package for interfaces now, so that reduces the choices a little. -Andrew.

On Oct 14, 2004, at 9:51 AM, Andrew Bennetts wrote:
On Thu, Oct 14, 2004 at 09:29:50AM -0400, Peter Hunt wrote:
I've been looking into adaption frameworks recently. I've found the following different frameworks:
PEP 246 PyProtocols Zope3 Twisted Nevow.compy
Can someone explain to me the differences between them, and why we have so many?
The SVN version Twisted uses Zope 3's zope.interface package for interfaces now, so that reduces the choices a little.
Nevow.compy is a nasty thing that will be going away soon. Right now, if you use Nevow with Twisted SVN, it doesn't use compy. Compy should be going away (leaving only the compatibility wrapper) soon after Twisted 2.0 is released, thus nevow will be using Zope Interface as well. So, really, your choices are only: PEP 246, Zope Interface, and PyProtocols. As I understand it, Zope Interface is an implementation and extension of PEP246: they both use the __adapt__ and __conform__ methods. Zope Interface adds a declarative interface, so you don't need to manually implement those methods, you can just say implements(IMyInterface). I dunno about how that differs from PyProtocols, but PyProtocols does have some compatibility code so that Zope Interface interfaces can work with it, instead of being an entirely different world. As to why there are so many: because everyone needed one. James

On Thu, 14 Oct 2004 11:15:25 -0400, James Y Knight <foom@fuhm.net> wrote:
Nevow.compy is a nasty thing that will be going away soon. Right now, if you use Nevow with Twisted SVN, it doesn't use compy. Compy should be going away (leaving only the compatibility wrapper) soon after Twisted 2.0 is released, thus nevow will be using Zope Interface as well.
Right now you must use compy.Interface to remember some interface on the context, otherwise it will crash. :(. I seeing this in weever (my sandbox) and I had to use compy.Interface to declare the interfaces that need to be remembered in the context. -- Valentino Volonghi aka Dialtone Now running FreeBSD 5.3-beta6 Blog: http://vvolonghi.blogspot.com Home Page: http://xoomer.virgilio.it/dialtone/

On Oct 14, 2004, at 11:35 AM, Valentino Volonghi wrote:
On Thu, 14 Oct 2004 11:15:25 -0400, James Y Knight <foom@fuhm.net> wrote:
Nevow.compy is a nasty thing that will be going away soon. Right now, if you use Nevow with Twisted SVN, it doesn't use compy. Compy should be going away (leaving only the compatibility wrapper) soon after Twisted 2.0 is released, thus nevow will be using Zope Interface as well.
Right now you must use compy.Interface to remember some interface on the context, otherwise it will crash. :(. I seeing this in weever (my sandbox) and I had to use compy.Interface to declare the interfaces that need to be remembered in the context.
If you're using Nevow with Twisted SVN, compy is already stubbed out, so that shouldn't be the case. But, yes, if you're using it with Twisted 1.3, you need to use compy or else random things won't work right. BTW, if you do use nevow with Twisted SVN I recommend doing: import warnings import twisted.python.components warnings.filterwarnings('ignore', '', twisted.python.components.ComponentsDeprecationWarning) or you'll be flooded with warnings. ;) James

On Thu, 14 Oct 2004 12:20:53 -0400, James Y Knight <foom@fuhm.net> wrote:
If you're using Nevow with Twisted SVN, compy is already stubbed out, so that shouldn't be the case. But, yes, if you're using it with Twisted 1.3, you need to use compy or else random things won't work right. BTW, if you do use nevow with Twisted SVN I recommend doing: import warnings import twisted.python.components warnings.filterwarnings('ignore', '', twisted.python.components.ComponentsDeprecationWarning) or you'll be flooded with warnings. ;)
Let me explain better :). Uhmmm I'm using Nevow with Twisted SVN but in weever I had to use compy.Interface in order to correctly use IFoo(ctx) api to get back the object from the context. If this is not known I guess it should be corrected, but this is the behaviour I get. Thx for the tip on warnings :) -- Valentino Volonghi aka Dialtone Now running FreeBSD 5.3-beta6 Blog: http://vvolonghi.blogspot.com Home Page: http://xoomer.virgilio.it/dialtone/
participants (4)
-
Andrew Bennetts
-
James Y Knight
-
Peter Hunt
-
Valentino Volonghi