Re: Question: Evaluate an string variable's value to a variable

2008-12-20 Thread Mir Nazim
On Dec 21, 11:56 am, "Chris Rebert" wrote: > On Sat, Dec 20, 2008 at 10:49 PM, Mir Nazim wrote: > > Just a quick question. > > > For example I have > > class X > pass > > > Then I do > x = X() > x.name = 'Nazim > > > Now my question is whether something like below is possi

Re: Question: Evaluate an string variable's value to a variable

2008-12-20 Thread Chris Rebert
On Sat, Dec 20, 2008 at 10:49 PM, Mir Nazim wrote: > Just a quick question. > > For example I have > class X pass > > Then I do x = X() x.name = 'Nazim > > Now my question is whether something like below is possible and how y = 'name' print x.y # How can x.y ca

Question: Evaluate an string variable's value to a variable

2008-12-20 Thread Mir Nazim
Just a quick question. For example I have >>> class X >>> pass Then I do >>> x = X() >>> x.name = 'Nazim Now my question is whether something like below is possible and how >>> y = 'name' >>> print x.y # How can x.y can be evaluated to x.name PS: In PHP this can be done by a $x->$y. I