i'm trying to learn OOP, python and pygame at the same time. so far it has been ok, but i stumbled onto a problem
here is the code that causes problems #!/usr/bin/python3.1 import pygame pygame.init() class BaseSprite(pygame.sprite.Sprite): def __init(self, imagefile): super(type(self), self).__init__() self.image = pygame.image.load(imagefile) self.image = self.image.convert() self.rect = self.image.get_rect() class Cloud(BaseSprite): """ cloud sprite scrolls down and moves side to side when it is reset """ IMAGE = 'cloud.gif' def __init__(self): super(type(self), self).__init__(type(self).IMAGE) def main(): cloud = Cloud() if __name__ == '__main__': main() when i run i get the following error: ........................... File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) File "/usr/local/lib/python3.1/dist-packages/pygame/sprite.py", line 129, in add else: self.add(*group) RuntimeError: maximum recursion depth exceeded while calling a Python object i can't figure out where and why the recursion occurs. can someone help me out? any advice is appreciated
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor