Re: refactoring so that multiple changes can be made with one variable?

2006-11-15 Thread Neil Cerutti
On 2006-11-15, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 15 Nov 2006 18:57:39 +1100, Steven D'Aprano ><[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: >> And last but most certainly not least, you can separate the >> adjustment values into (say) an INI file, read them

Re: refactoring so that multiple changes can be made with one variable?

2006-11-15 Thread Steven D'Aprano
On Tue, 14 Nov 2006 10:41:53 -0500, John Salerno wrote: > My code is below. For now I'm focusing on the lines where health (and > armor) are increased in each character class. Let's say I decided to > change the amount of increase in the future. As it is now, I'd have to > go to each character

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
John Salerno wrote: > Paddy wrote: > > > You could keep a handle on all object instances created then go through > > the objects making appropriate changes, e.g: > > > > > > class Character(object): > > instances = [] > > def __init__(self, name, strength, dexterity, intelligence): > >

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread James Stroud
John Salerno wrote: > My code is below. For now I'm focusing on the lines where health (and > armor) are increased in each character class. Let's say I decided to > change the amount of increase in the future. As it is now, I'd have to > go to each character class and change the number so that e

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread John Salerno
Paddy wrote: > You could keep a handle on all object instances created then go through > the objects making appropriate changes, e.g: > > > class Character(object): > instances = [] > def __init__(self, name, strength, dexterity, intelligence): > instances.append(self) >

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
John Salerno wrote: > My code is below. For now I'm focusing on the lines where health (and > armor) are increased in each character class. Let's say I decided to > change the amount of increase in the future. As it is now, I'd have to > go to each character class and change the number so that ea

refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread John Salerno
My code is below. For now I'm focusing on the lines where health (and armor) are increased in each character class. Let's say I decided to change the amount of increase in the future. As it is now, I'd have to go to each character class and change the number so that each is still in a good rela