Inheritance doesn't work

Robert Kern robert.kern at gmail.com
Mon Dec 4 05:22:18 EST 2006


zefciu wrote:
> I have a problem with inheritance under python.  The class definition is  
> longer, but the troublesome thing is:
> 
>  from PIL import Image
> class MandelbrotImage (Image):
> 	pass
> 
> I am getting the following error:
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "mandelimage.py", line 3, in ?
>      class MandelImage (Image):
> TypeError: Error when calling the metaclass bases
>      module.__init__() takes at most 2 arguments (3 given)
> 
> 
> I am using python 2.4 from the Debian (Sid) packages.
> 
> Is it a bug, or am I doing something wrong?

You're doing something wrong. PIL.Image is a module, not a class.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list