code: def prev_position(self, pos):
          
          candidate = None
          if pos is not None:
              prevsib = self.prev_sibling_position(pos)  # is None if first
              if prevsib is not None:
                  candidate = self.last_decendant(prevsib)
              else:
                  parent = self.parent_position(pos)
                  if parent is not None:
                      candidate = parent
          return candidate
docs: returns the previous position in depth-first order