list vs tuple
Emile van Sebille
emile at fenx.com
Sat Mar 31 16:57:35 EST 2001
"""Grant me the serenity to accept the things I cannot change, the courage
to change the things I can, and, above all, grant me the wisdom to know the
difference."""
--
Emile van Sebille
emile at fenx.com
---------
"deadmeat" <root@[127.0.0.1]> wrote in message
news:lWrx6.1057$p5.4152 at news1.rivrw1.nsw.optushome.com.au...
> > THERE IS NO DIFFERENCE.
>
> What happens to the objects is not the point, what happens to what I put
> into a and b is the point.
>
> >>> a = 1
a points somewhere
> >>> b = a
b points to the same place
> >>> a = 2
a now points elsewhere
> >>> b
what else would you expect?
> 1
>
> >>> a = [1,2,3]
a points somewhere
> >>> b = a
b points to the same place
> >>> a[0] = 0
the thing a points to is changed
> >>> b
what else would you expect?
> [0, 2, 3]
>
> Are you saying there is no difference (IN THE *RESULT*) between these?
Are
> you able to read?
>
> What goes on in the background is NOT THE POINT. I only care about the
> values I put into them, and what happens after b = a.
>
>
>
>
More information about the Python-list
mailing list