Re: [Tutor] Can this be done easly

2010-09-19 Thread Peter Otten
Roelof Wobben wrote: >> Hint: why does this work: >> >>> def __init__(self, x=0, y=0): >> >> ...while this doesnt: >> >>> def _init_(self, base_point, width=0, length=0): >> >> Peter > Maybe because base_point has no value ? No. One __init__ has two underscores (correct) on each side, the other

Re: [Tutor] Can this be done easly

2010-09-19 Thread Alan Gauld
"Roelof Wobben" 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 mes

Re: [Tutor] Can this be done easly

2010-09-19 Thread Roelof Wobben
> To: tutor@python.org > From: __pete...@web.de > Date: Sun, 19 Sep 2010 18:04:25 +0200 > Subject: Re: [Tutor] Can this be done easly > > Roelof Wobben wrote: > >> When I change everything to this : > >> I get this me

Re: [Tutor] Can this be done easly

2010-09-19 Thread Peter Otten
Roelof Wobben wrote: > When I change everything to this : > I get this message : > > Traceback (most recent call last): > File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 13, in > > rechthoek = Rectangle (punt,20,30) > TypeError: object.__new__() takes no parameters Hint:

Re: [Tutor] Can this be done easly

2010-09-19 Thread Roelof Wobben
> Date: Sun, 19 Sep 2010 14:19:46 +0200 > From: knack...@googlemail.com > To: tutor@python.org > Subject: Re: [Tutor] Can this be done easly > > Am 19.09.2010 10:49, schrieb Roelof Wobben: >> >> >> Hello, >> &

Re: [Tutor] Can this be done easly

2010-09-19 Thread Knacktus
Am 19.09.2010 10:49, schrieb Roelof Wobben: Hello, I have this programm : class Point: def __init__(self, x=0, y=0): self.x = x self.y = y class Rectangle(Point): def _init_(self, width=0, length=0): self.width = width self.length = length Yo

[Tutor] Can this be done easly

2010-09-19 Thread Roelof Wobben
Hello, I have this programm : class Point: def __init__(self, x=0, y=0): self.x = x self.y = y class Rectangle(Point): def _init_(self, width=0, length=0): self.width = width self.length = length punt = Point(3,4) rechthoek = Rectang