Better solution

Bo M. Maryniuck b.maryniuk at forbis.lt
Wed Aug 21 10:52:15 CEST 2002


On Wednesday 21 August 2002 10:24, Michael Hudson wrote:
> > Also what is [:]?
> A slice.
"a zlize". :-) Thank you, but I know this! What the advantage and different 
between:

>>> a = [1,2,3]
>>> a
[1, 2, 3]
>>> id(a)
135729324
>>> b = a
>>> b 
[1, 2, 3]
>>> id(b)
135729324

...and:

>>> a[:] = [1,2,3]
>>> a
[1, 2, 3]
>>> id(a)
135729324
>>> b[:] = a
>>> b
[1, 2, 3]
>>> id(b)
135729324

?

-- 
Regards, Bogdan

If you are angry with someone, you should walk a mile in their shoes... then
you'll be a mile away from them, and you'll have their shoes.





More information about the Python-list mailing list