[Tutor] Can this be done easly
Alan Gauld
alan.gauld at btinternet.com
Sun Sep 19 18:12:57 CEST 2010
"Roelof Wobben" <rwobben at hotmail.com> wrote
> When I change everything to this :
>
> class Rectangle(object):
> def _init_(self, base_point, width=0, length=0):
> self.base_point = base_point
> self.width = width
> self.length = length
>
> punt = Point(3,4)
> rechthoek = Rectangle (punt,20,30)
>
> I get this message :
>
> Traceback (most recent call last):
> File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 13,
> in <module>
> rechthoek = Rectangle (punt,20,30)
> TypeError: object.__new__() takes no parameters
Very odd, but are you using IDLE or a similar IDE?
Have you remembered to reload the module? Just a thought...
Alan G.
More information about the Tutor
mailing list