TypeError: object.__init__() takes no parameters

Terry Reedy tjreedy at udel.edu
Fri Sep 9 19:31:21 CEST 2011


On 9/9/2011 1:47 AM, Oliver wrote:

> If I want to run shapes.py I receive this error message:

Others have explained why code that ran once now does not.

> class Container(object):
>      """Container to store  a number of non-overlapping rectangles."""
>      def __init__(self, xsize=1200, ysize=800):
>          super(Container, self).__init__(xsize, ysize)

Remove this line and the error will go away. It *never* did anything.

>          self.rect = Rectangle(0, 0, xsize, ysize)
>          self.boxes = []
>          self.last_placement_strategy = 0

-- 
Terry Jan Reedy




More information about the Python-list mailing list