def link_tail(self, node):
        '''Add a node to the tail.'''
        assert not node.head
        old_tail = self.tail

        if old_tail:
            assert old_tail.head == self
            old_tail.head = node
            node.tail = old_tail

        node.head = self
        self.tail = node
Add a node to the tail.