What's “better” the reverse method or the reversed built-in function?
What is typically regarded as more Pythonic/better/faster to use, the reverse method or the reversed built-in function? Both in action: _list = list(xrange(4)) print _list rlist = list(reversed(_list)) print rlist _list.reverse() print _list Depends on whether you want to reverse the list in-place (i.e. change the list) or not. No other real difference. Often using reversed leads to nicer code. foo.reverse() actually reverses the elements in the container. reversed() doesn't actually reverse anything, it merely returns an object that can be used to iterate over the container's elements in