multiple inheritance from list and other class

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Jan 8 01:42:01 EST 2012


On Sat, 07 Jan 2012 17:16:22 -0800, lars van gemerden wrote:

> Hello,
> 
> I have an error message i do not understand:
> 
> My code is in essence:

The code you give works fine. It does not show the error you say it does. 
Please test your code before posting and ensure it actually fails the way 
you expect.

It is perfectly fine to use multiple inheritance in the way you show. 
Here is an even simpler example:

py> class Spam(object):
...     pass
... 
py> class Ham(list, Spam):
...     pass
... 
py> 
py> h = Ham([1, 2, 3])
py> 

And no exception is raised.


-- 
Steven



More information about the Python-list mailing list