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,
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
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
"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
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