Any other Python flaws?

Martin Sandin msandin at hotmail.com
Fri Jun 15 03:37:22 EDT 2001


> ...I got an array with 100 elements, all 0.
> 
> I think python is OK here.

Except you didn't =) You got a list of 10 references to a list with 10
references to the number 0. That the inner list is a list of
references to the same object doesn't matter much, it's immutable
anyhow. But the outer list...

I's not strange, but it might be a bit surprising, isn't exactly
'intuitive'.


-
Martin Sandin
http://come.to/vague



More information about the Python-list mailing list