lst1 = ['one', 2, 3]
// What is the best way of the following -- or is there another way?
lst2 = list(lst1)
lst2 = lst1[:]
import copy
lst2 = copy.copy(lst1)
I know what algorithms are, but I have never consciously used or created one for any of the programming that I have done. So I'd like to get a book about the subject - I'd prefer if it was in python but that's not a strict requirement. What book about algorithms helped you most to understand, use, and create algorithms?
One book per answer so they can be voted on...
I want to override the getattr method on a class to do something fancy but I don't want to break the default behavior.
What's the correct way to do this?
lst1 = ['one', 2, 3]
// What is the best way of the following -- or is there another way?
lst2 = list(lst1)
lst2 = lst1[:]
import copy
lst2 = copy.copy(lst1)