[Zope] Error:unbound method __init__() must be called with instanceas first argument

Dragos Chirila d.chirila at finsiel.ro
Fri Apr 9 08:39:54 EDT 2004


Hi

Try like this:

CA.__dict__['__init__'](self)

Regards,
Dragos

> --- file A.py ---
> class CA:
>     "class for my needs"
>     def __init__(self, a=0):
>         "init"
>         self.__a=a
>
> --- file B.py ---
> from A import CA
> from OFS import SimpleItem
> class CB(SimpleItem.SimpleItem , CA ):
>     "class B"
>     def __init__(self, id, docN):
>         "init"
>         CA.__init__(self)
>         self.id=id
>         self.docN=docN
>
>  On add object of CB Zope write:
>         Site Error
>         An error was encountered while publishing this resource.
>         Error Type: TypeError
>         Error Value: unbound method __init__() must be called with
instance
> as first argument
>
> Where is this Error?
>
> Regard,
> Serg.
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>





More information about the Zope mailing list