[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-06-04 Thread Laurie Opperman
Change by Laurie Opperman : -- versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-05-16 Thread Laurie Opperman
Laurie Opperman added the comment: I think I may have broken bedevere-bot by request change reviews before the PR was assigned... -- ___ Python tracker ___

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-05-09 Thread Laurie Opperman
Laurie Opperman added the comment: Would this change also have to copy implemented in the new ZipFile Pathlib API? https://bugs.python.org/issue36832 -- ___ Python tracker

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-29 Thread Laurie Opperman
Laurie Opperman added the comment: I've updated the pull-request to list directories pointed to by listed symbolic links, preventing cyclic listing. An extra instance method `pathlib.Path._iterdir_recursive` was added for this. We still need to decide whether to yield the directories

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Laurie Opperman
Laurie Opperman added the comment: Having `iterdir(recursive=True)` recurse into symlinks to directories would mean we would either not yield those symlinks, or we yield those symlinks and all other directories. I feel like not yielding directories is the way to go, but it's easy enough to

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Paul Ganssle
Paul Ganssle added the comment: > I don't spend enough time dealing with symlinks to have strong opinions > there, but given we have ways to resolve symlinks but not to get back to the > original name (and I *have* had to deal with issues where I've needed to find > the original name from

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Steve Dower
Steve Dower added the comment: Having spent more time than I'm proud of recursing through directories, I'd be happy enough with a convenience function that has sensible defaults. If I want breadth-first recursion (and I often do), I'll write it myself. I have a slight preference for getting

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Paul Ganssle
Paul Ganssle added the comment: > rglob and glob also return a generator. My mistake, I didn't notice the `sorted` in the `rglob` documentation and thought it was emitting a list. > By that logic, we should remove `Path.iterdir()` in favour of > `Path.glob('*')`. What *is* the case for

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-12 Thread Laurie Opperman
Laurie Opperman added the comment: > Is the behaviour you're proposing any different from using `Path.rglob('*')`? By that logic, we should remove `Path.iterdir()` in favour of `Path.glob('*')`. In addition, having `iterdir` the way it is makes it easy for subclasses to extend its

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > I believe `rglob("*")` is eager, while `iterdir` is lazy. rglob and glob also return a generator. Slightly related, pathlib.walk was proposed in the past in python-ideas : https://mail.python.org/pipermail/python-ideas/2017-April/045398.html

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Paul Ganssle
Paul Ganssle added the comment: > Is the behaviour you're proposing any different from using Path.rglob('*')? I believe `rglob("*")` is eager, while `iterdir` is lazy. @Epic_Wink: > This would be trivial to implement as 'iterdir' can simply yield from > subdirectories' 'iterdir'. One thing

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread SilentGhost
SilentGhost added the comment: Is the behaviour you're proposing any different from using Path.rglob('*')? -- nosy: +SilentGhost ___ Python tracker ___

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12712 stage: -> patch review ___ Python tracker ___ ___

[issue36602] Recursive directory list with pathlib.Path.iterdir

2019-04-11 Thread Laurie Opperman
New submission from Laurie Opperman : Currently, 'pathlib.Path.iterdir' can only list the contents of the instance directory. It is common to also want the contents of subdirectories recursively. The proposal is for 'pathlib.Path.iterdir' to have an argument 'recursive' which when 'True'