[Zope-dev] Extension class and __init__
I had the bright idea of defining a mixin class whose methods I thought I could use in my regular Zope product classes: class AMixin: def __init__(self): blah, blah blah class B(AMixin, Persistent, Folder, ): def __init__(self): # do some of my own stuff AMixin.__init__(self) This fails with the warning (as I recall) that the unbound method AMixin.__init__ needs to be called with an instance as its first argument. (I've stripped the example down to give what I think are the essentials). self in the context of B is an Extension class, and I'm guessing this is making AMixin unhappy because it's not. I assume I'll have the same problem with other methods that I attempt to access using AMixin.foo(self). Can anyone confirm this diagnosis? And what's the best solution? I have redefined things class AMixin: def _mixin_init(self): #stuff class B(AMixin, .): def __init__(self): #my own stuff self._mixin_init(self) and this seems to work, but I wonder if there's a way to get the classes to play together better (maybe class AMixin(ExtensionClass):? though since ExtensionClass is a type I guess that's not exactly it). This was after already discovering that isinstance doesn't work with ExtensionClass (which I see confirmed on the list, along with the fact that ExtensionClass generally has a lot of rough spots and may be on the way out). This is with Zope 2.5.1. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Extension class and __init__
Ross, Please see the bit about inheritedAttribute in the document inside Zope's source tree named lib/Components/ExtensionClass/doc/ExtensionClass.html. HTH, - C - Original Message - From: Ross Boylan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Ross Boylan [EMAIL PROTECTED] Sent: Monday, July 22, 2002 3:30 AM Subject: [Zope-dev] Extension class and __init__ I had the bright idea of defining a mixin class whose methods I thought I could use in my regular Zope product classes: class AMixin: def __init__(self): blah, blah blah class B(AMixin, Persistent, Folder, ): def __init__(self): # do some of my own stuff AMixin.__init__(self) This fails with the warning (as I recall) that the unbound method AMixin.__init__ needs to be called with an instance as its first argument. (I've stripped the example down to give what I think are the essentials). self in the context of B is an Extension class, and I'm guessing this is making AMixin unhappy because it's not. I assume I'll have the same problem with other methods that I attempt to access using AMixin.foo(self). Can anyone confirm this diagnosis? And what's the best solution? I have redefined things class AMixin: def _mixin_init(self): #stuff class B(AMixin, .): def __init__(self): #my own stuff self._mixin_init(self) and this seems to work, but I wonder if there's a way to get the classes to play together better (maybe class AMixin(ExtensionClass):? though since ExtensionClass is a type I guess that's not exactly it). This was after already discovering that isinstance doesn't work with ExtensionClass (which I see confirmed on the list, along with the fact that ExtensionClass generally has a lot of rough spots and may be on the way out). This is with Zope 2.5.1. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Memory Leaks
Hey all, A client of mine seems to be plagued with memory leaks. I have a CMF / Plone site on We fixed some security issues that caused a major leak this is the same I believe as http://collector.zope.org/Zope/421, by jiggling settings this no longer an issue. Anyway we are still getting some minor leaks that severly limit the amount of the traffic the box is going to be able take. Lots of different objects are being leaked, including good old DateTime, however I dont believe its this, DateTime just happens to be there. Possible culprits are (trimmed down debug page) ZPT: Products.PageTemplates.Expressions.PathExpr, Products.PageTemplates.Expressions.SubPathExpr, Products.PageTemplates.TALES.TALESError etc... or AccessControl AccessControl.unauthorized.Unauthorized, AccessControl.SecurityManager.SecurityManager etc... A quick rummage through LeakFinder hasn't helped too much so Im not sure what too recommend. Good old install ZEO and restart Zope every few hours? Is anyone else having issues? Configuration: Plone 0.99 Almost There CMF Beta 1.3 beta 1 Zope 2.5.1 Python 2.1.3 RedHat Linux 7.1 Using Apache and pcgi to serve... -- Andy McKay ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )