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