docs: def _collect_dirty_tabs(self, skip=None, tab_range=None):
          """
          Collects the list of dirty tabs
  
          :param skip: Tab to skip (used for close_others).
          """
          widgets = []
          filenames = []
          if tab_range is None:
              tab_range = range(self.count())
          for i in tab_range:
              widget = self.widget(i)
              try:
                  if widget.dirty and widget != skip:
                      widgets.append(widget)
                      if widget.file.path:
                          filenames.append(widget.file.path)
                      else:
                          filenames.append(widget.documentTitle())
              except AttributeError:
                  pass
          return widgets, filenames