multiple inheritance from list and other class

lars van gemerden lars at
Sat Jan 7 20:16:22 EST 2012


I have an error message i do not understand:

My code is in essence:

class A(object):
#no __new__ or __init__
    def meth1(self, args):
        #some code
    def meth2(self, args):
        #some code

class B(list, A)

b = B([1,2,3,4])


Traceback (most recent call last):
  File "D:\Documents\Code\Eclipse\workspace\FlowTools\",
line 431, in <module>
  File "D:\Documents\Code\Eclipse\workspace\FlowTools\",
line 381, in testolist
    b = B([0,1,2,3,4])
TypeError: B() takes exactly 2 arguments (1 given)

(adapted the error to the example classes)

Can anyone help/explain?

Cheers, Lars

More information about the Python-list mailing list