Tom Anderson wrote: > > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l > > ?
Why not m = L[:] instead of m = []; m[:] = L ??? > > That's what i've been doing. The other day, i realised that i could just > do: > > l = someList() > m = list(l) > > The same works for copying dicts. Whilst it's still not utterly obvious > that what this is about is making a copy, it's more obvious, cleaner, > shorter and probably faster than the slice assignment, which is really > kludgy (almost intercalorific, in fact - or even perlish!). -- http://mail.python.org/mailman/listinfo/python-list