[issue19767] pathlib: iterfiles() and iterdirs()

2014-11-10 Thread Wolfgang Langner
Wolfgang Langner added the comment: 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() ? -- nosy: +tds333 ___ Python tracke

[issue19767] pathlib: iterfiles() and iterdirs()

2014-05-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: 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 subdir

[issue19767] pathlib: iterfiles() and iterdirs()

2014-05-10 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue19767] pathlib: iterfiles() and iterdirs()

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Having an `iterdirs()` method next to `iterdir()` is very confusing. We should find something else, so how about `files()` and `subdirs()`? -- nosy: +pitrou ___ Python tracker

[issue19767] pathlib: iterfiles() and iterdirs()

2013-11-25 Thread R. David Murray
R. David Murray added the comment: Beta is out, so this issue must be targeted for 3.5. -- nosy: +r.david.murray versions: +Python 3.5 -Python 3.4 ___ Python tracker ___

[issue19767] pathlib: iterfiles() and iterdirs()

2013-11-25 Thread STINNER Victor
STINNER Victor added the comment: See also issue #11406 which is more generic. -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-

[issue19767] pathlib: iterfiles() and iterdirs()

2013-11-25 Thread Jonas H.
New submission from Jonas H.: >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()]` . --