Advertisement
dvdjaco

Untitled

Mar 15th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <divad> jesyspa: we were wondering yesterday, what would be the best way to make a copy of a multidimensional list? (besides importing some module that provides a "matrix" data type)
  2. <jesyspa> As in, deep-copy two levels?
  3. <divad> yes
  4. <jesyspa> [x[:] for x in li]
  5. <divad> aaaaaahh
  6. <divad> nice :-)
  7. <divad> thx
  8. <jesyspa> (to be honest though, I tend to be suspicious of two-dimensional lists, and outright afraid of anything deeper than that. :P)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement