Problems with subclassing

Alexander Stante alex_stante at yahoo.de
Sun Sep 12 12:38:40 EDT 2004


Hello,

I have the following problem. I want to subclass from the pygame class
Surface, but I can't get it working:

class sprite(Surface):
def __init__(self, image_array, palette):
"some code here"

when I want to create a instance with:

gfx.sprite(arrayi, palette)


I get the following error message:
TypeError: argument 1 must be sequence of length 2, not 100

It seems that the constructor of Surface is not overrided by the one in
sprite, but why?




More information about the Python-list mailing list