Re: Dynamic property names on class

2009-11-13 Thread Diez B. Roggisch
Bryan schrieb: On Nov 13, 9:34 am, "Diez B. Roggisch" wrote: Bryan schrieb: I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class T

Re: Dynamic property names on class

2009-11-13 Thread Bryan
On Nov 13, 9:34 am, "Diez B. Roggisch" wrote: > Bryan schrieb: > > > > > I have several properties on a class that have very similar behavior. > > If one of the properties is set, all the other properties need to be > > set to None.  So I wanted to create these properties in a loop like: > > > cla

Re: Dynamic property names on class

2009-11-13 Thread Diez B. Roggisch
Bryan schrieb: I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class Test(object): for prop in ['foo', 'bar', 'spam']:

Dynamic property names on class

2009-11-13 Thread Bryan
I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class Test(object): for prop in ['foo', 'bar', 'spam']: # Attribut