On Wed, 22 Dec 2004 22:29:44 GMT, "Matt Gerrans" <[EMAIL PROTECTED]>
wrote:

>Actually i was not mutable.   Try this:

>i = 1
>id(i)
>i += 1
>id(i)

Looks like I will have to read the Language Reference anyway. :-(

<snip, thanks>
>Because you are assigning the local reference variable L to a new list, 
>instead of modifying that original default list that was created.

>Is that more clear, or is it now more unclear?   ;) 

Clear now, but I have to say for someone who's been doing
some C programming in the past it is pretty confusing, because 
I'm used to think of any variable as basically a place in memory
with a pointer to it, so anything without #define or const was
considered "mutable" (gawd I still hate pointers).

C-style thinking considered harmful when programming in Python. :o)




--
It's a man's life in a Python Programming Association.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to