On 8 Nov 2005 01:43:43 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> But if lst[42]["pos"] happens to hold an integer value, then
>
> a = lst[42]["pos"]
>
> will _copy_ that integer value into 'a', right?

Nope. It will bind the name 'a' to the integer object.

> Changing 'a' will not
> change the value at lst[42]["pos"]

Integers are immutable - they can't be modified. So, "Changing 'a'"
means binding the name 'a' to a different object. This will have no
effect on other references to the original object.

Reset your brain - <http://effbot.org/zone/python-objects.htm>.

--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to