Hi,

On Mon, Sep 18, 2006 at 03:37:28PM +0100, John Smith wrote:
> Hi everyone!
> 
> the class
> zope.app.publisher.browser.fileresource.FileResource
> inherits from BrowserView and Resource in that order.
> 
> As far as I can work out, the __init__ method in
> Resource
> (zope.app.publisher.browser.resource.Resource) is
> never called.

(Please correct me if I'm wrong, I'm not a Python guru :-) )

Whenever you inherit from two classes, only the first class'
__init__ method is called implicitely on create of a new instance.

If you want both base classes' init method to be called, do something
like this:

class MyView(BrowserView,Second):
   def __init__(self,context,request):
      BrowserView.__init__(self,context,request)
      Second.__init__(self,context,request)

Regards,

Frank
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to