code: def _selectedLinesRange(self):
          
          (startLine, startCol), (endLine, endCol) = self._qpart.selectedPosition
          start = min(startLine, endLine)
          end = max(startLine, endLine)
          return start, end
docs: Selected lines range for line manipulation methods