Thanks, this was super helpful for me to work through the concept. I couldn't get it working at first, and I realized it was your very last line: return previous_node; I think it might be helpful for you to clarify what you are doing with that line.
What I discovered was that the last item found in the list needs to be explicitly assigned as the list's new head. I guess wherever you are calling reverse_linked_list() in another program you must handle that, which is why you're returning the previous_node. In my implementation, I wanted to handle that new head assignment inside the reverse function, so I ended up with this:
# reverse: reverse the linked list
def reverse(self):
# start at the top of the stack
current = self.head
# initialize
temporary = None
previous = None
# walk through the linked list
while (current != None):
# don't let go of your chain!
temporary = current.next
# swap the link direction
current.next = previous
# attach current to the next nodes "previous"
previous = current
# step to the "next" node; stored in temp
current = temporary
# once reached the end/bottom of the stack
# it's important to make that bottom item the new head
self.head = previous