Re: [Tutor] pure function problem

2010-09-28 Thread Alan Gauld
Just home from vacation so jumping in late... "Roelof Wobben" wrote class tijd : pass Others have solved this for you but you don't appear to have picked up on the point made by Jeremy that you are not initialising your class's attributes. By only creating the attributes within the funct

Re: [Tutor] pure function problem

2010-09-24 Thread Roelof Wobben
> Date: Fri, 24 Sep 2010 06:29:03 -0400 > From: da...@ieee.org > To: rwob...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor] pure function problem > > On 2:59 PM, Roelof Wobben wrote: >> >> >> --

Re: [Tutor] pure function problem

2010-09-24 Thread Dave Angel
On 2:59 PM, Roelof Wobben wrote: From: st...@pearwood.info On Fri, 24 Sep 2010 06:20:25 am Roelof Wobben wrote: time =ijd() [...] print time(uitkomst) Why are you calling time as a function, when it is a tijd instance? Hello Steve, I found t

Re: [Tutor] pure function problem

2010-09-24 Thread David Hutto
On Fri, Sep 24, 2010 at 1:43 AM, Roelof Wobben wrote: > > > > >> From: st...@pearwood.info >> To: tutor@python.org >> Date: Fri, 24 Sep 2010 13:00:40 +1000 >> Subject: Re: [Tutor] pure function problem >> >&

Re: [Tutor] pure function problem

2010-09-23 Thread Roelof Wobben
> From: st...@pearwood.info > To: tutor@python.org > Date: Fri, 24 Sep 2010 13:00:40 +1000 > Subject: Re: [Tutor] pure function problem > > Roelof, please learn to delete unnecessarily quoted text. There's no > need to quoted t

Re: [Tutor] pure function problem

2010-09-23 Thread Steven D'Aprano
Roelof, please learn to delete unnecessarily quoted text. There's no need to quoted the entire discussion every time you answer. On Fri, 24 Sep 2010 06:20:25 am Roelof Wobben wrote: > time = tijd() [...] > print time(uitkomst) Why are you calling time as a function, when it is a tijd instance?

Re: [Tutor] pure function problem

2010-09-23 Thread Roelof Wobben
> From: rwob...@hotmail.com > To: tutor@python.org > Subject: RE: [Tutor] pure function problem > Date: Thu, 23 Sep 2010 10:15:07 + > > > >> Date: Thu, 23 Sep 2010 05:36:58 -0400 >> Subject: Re: [Tutor] pure function pro

Re: [Tutor] pure function problem

2010-09-23 Thread Roelof Wobben
> Date: Thu, 23 Sep 2010 05:36:58 -0400 > Subject: Re: [Tutor] pure function problem > From: jemejo...@gmail.com > To: tutor@python.org > CC: rwob...@hotmail.com > > The problem is that your class definition doesn't do anything to > explicitly set those attributes.

Re: [Tutor] pure function problem

2010-09-23 Thread Jeremy Jones
The problem is that your class definition doesn't do anything to explicitly set those attributes. On Thu, Sep 23, 2010 at 4:58 AM, Roelof Wobben wrote: > class tijd : >    pass You're not doing any explicit setting of attributes at the class level. > time = tijd() > time.hour = 20 > time.minu

[Tutor] pure function problem

2010-09-23 Thread Roelof Wobben
Hello, I have to rewrite a function to a pure function. So i have this : class tijd : pass def increment(time, seconds): sum = tijd() sum.seconds = time.seconds + seconds if sum.seconds> 60 : minutes, seconds = divmod(sum.seconds, 60) sum.seconds = seco