Another thing: how does super() work wrt. multiple inheritance? It seems like it returns only the first superclass.

regards
Andre



On 9/8/06, Georg Brandl <[EMAIL PROTECTED]> wrote:
metaperl wrote:
> On p.282 of "Python Cookbook" and in the Python docs on calling super:
> http://www.python.org/download/releases/2.2.3/descrintro/#cooperation
>
> it is clear that the first argument to super is a class and not a type.
> However, for the code below, I am getting an error when attempting to
> provide a class as my first argument and don't understand why. Also,
> since this is my first attempt at writing anything of any seriousness
> in Python, any other feedback is welcome.

"super" only works for new-style classes.

You could make "ftputilx" new-style by inheriting from object and FTPHost,
but FTPHost is still old-style, and I don't know if that's okay with super.

So in your case it would be advisable to use

FTPHost.__init__(self)

instead of

super(ftputilx, self).__init__()

Georg
--
http://mail.python.org/mailman/listinfo/python-list



--
Dr. Andre P. Meyer                         http://python.openspace.nl/meyer
TNO Defence, Security and Safety          http://www.tno.nl/
Delft Cooperation on Intelligent Systems   http://www.decis.nl/

Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. - Douglas Adams
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to