Re: [Tutor] making onthefly attributes persistent

2010-12-14 Thread Knacktus
Am 13.12.2010 23:50, schrieb Jojo Mwebaze: On Mon, Dec 13, 2010 at 8:44 PM, Alan Gauld mailto:alan.ga...@btinternet.com>> wrote: "Jojo Mwebaze" mailto:jojo.mweb...@gmail.com>> wrote Assuming i have a class bank as below . class bank(object): def __init__(self,

Re: [Tutor] making onthefly attributes persistent

2010-12-13 Thread ALAN GAULD
n Gauld >Cc: tutor@python.org >Sent: Monday, 13 December, 2010 22:50:49 >Subject: Re: [Tutor] making onthefly attributes persistent > > > > >On Mon, Dec 13, 2010 at 8:44 PM, Alan Gauld wrote: > > >>"Jojo Mwebaze" wrote >> >> >>Assuming i

Re: [Tutor] making onthefly attributes persistent

2010-12-13 Thread Jojo Mwebaze
On Mon, Dec 13, 2010 at 8:44 PM, Alan Gauld wrote: > > "Jojo Mwebaze" wrote > > Assuming i have a class bank as below . >> >> class bank(object): >> def __init__(self, bal=0): >> self.bal = bal >> def deposit(self, amount): >> self.bal+=amount >> print self.bal >> >> I define a

Re: [Tutor] making onthefly attributes persistent

2010-12-13 Thread Alan Gauld
"Jojo Mwebaze" wrote Assuming i have a class bank as below . class bank(object): def __init__(self, bal=0): self.bal = bal def deposit(self, amount): self.bal+=amount print self.bal I define a method debit - which i add to the class onthefly bank.debit = debit #I can

[Tutor] making onthefly attributes persistent

2010-12-13 Thread Jojo Mwebaze
Hey Tutor Assuming i have a class bank as below . class bank(object): def __init__(self, bal=0): self.bal = bal def deposit(self, amount): self.bal+=amount print self.bal I define a method debit - which i add to the class onthefly def debit(self, amt): self.bal-=am