python doubly linked list implementation