code: def iter_paths(self, pathnames=None, mapfunc=None):
          
          pathnames = pathnames or self._pathnames
          if self.recursive and not pathnames:
              pathnames = ['.']
          elif not pathnames:
              yield []
  
          if mapfunc is not None:
              for mapped_paths in map(mapfunc, pathnames):
                  for path in mapped_paths:
                      if self.recursive and (os.path.isdir(path) or os.path.islink(path)):
                          for t in os.walk(path, followlinks=self.follow_symlinks):
                              for filename, values in self.iglob(os.path.join(t[0], '*')):
                                  yield filename, values
                      else:
                          empty_glob = True
                          for filename, values in self.iglob(path):
                              yield filename, values
                              empty_glob = False
                          if empty_glob:
                              yield path, None
          else:
              for path in pathnames:
                  if self.recursive and (os.path.isdir(path) or os.path.islink(path)):
                      for t in os.walk(path, followlinks=self.follow_symlinks):
                          for filename, values in self.iglob(os.path.join(t[0], '*')):
                              yield filename, values
                  else:
                      empty_glob = True
                      for filename, values in self.iglob(path):
                          yield filename, values
                          empty_glob = False
                      if empty_glob:
                          yield path, None
docs: Special iteration on paths. Yields couples of path and items. If a expanded path
          doesn't match with any files a couple with path and `None` is returned.
  
          :param pathnames: Iterable with a set of pathnames. If is `None` uses the all \
          the stored pathnames.
          :param mapfunc: A mapping function for building the effective path from various \
          wildcards (eg. time spec wildcards).
          :return: Yields 2-tuples.