From my personal experience, listing all real files and all subdirectories in a directory is a very common use case. Here's a patch that adds the `iterfiles()` and `iterdirs()` methods as a shortcut for `[f for f in p.iterdir() if f.is_dir/file()]` .
Here is a patch with the proposed API. The API for convenience: def files(self, include_symlinks=True): """Iterate over the regular files in this directory. """ def subdirs(self, include_symlinks=True): """Iterate over the subdirectories in this directory. """
Why not implement this pattern with def dirs(pattern) and def files(pattern) where both are a simple shortcut for (p for p in mypath.glob(pattern) if p is_file()) or is_dir() ?