Re: assignment to reference

2005-10-27 Thread Loris Caren
Thank you all for your replies. They have helped me understand
that immutable means just that! Blame my c heritage where a
pointer allows you to scribble over anything.
-- 
http://mail.python.org/mailman/listinfo/python-list


assignment to reference

2005-10-26 Thread Loris Caren
If

a = 'apple'
b = 'banana'
c = 'cabbage'

How can I get something like:-

for i in 'abc':
r = eval(i)
if r == 'cabbage': r = 'coconut'

actually change the object referenced by r rather
than creating a new object temporarily referenced by it?

I've tried playing with eval and exec without the desired
effect.
-- 
http://mail.python.org/mailman/listinfo/python-list