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 sure there is some way in
Python also


Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to