Re: FIXED: Dynamically reference variables in object

2014-03-26 Thread Chris Angelico
On Wed, Mar 26, 2014 at 10:49 PM, Ben Collier wrote: > I know that I can dynamically reference a variable with locals()["i"], for > instance, but I'd like to know how to do this with a variable in an object. > > If I have an object called "device", with variables called attr1, attr2 .. > attr50,

Re: FIXED: Dynamically reference variables in object

2014-03-26 Thread Antoon Pardon
On 26-03-14 12:49, Ben Collier wrote: > Hi all, > > I know that I can dynamically reference a variable with locals()["i"], for > instance, but I'd like to know how to do this with a variable in an object. > > If I have an object called "device", with variables called attr1, attr2 .. > attr50, h