New submission from Laurie Opperman <laurie_opper...@hotmail.com>:

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' will cause 'iterdir' to yield contents of subdirectories 
recursively.

This would be trivial to implement as 'iterdir' can simply yield from 
subdirectories' 'iterdir'.

A decision would have to be made whether to continue to yield the 
subdirectories, or skip them. Another decision would be for whether each path 
should be resolved before checking if it is a directory to be recursed into.

----------
components: Library (Lib)
messages: 339959
nosy: Epic_Wink
priority: normal
severity: normal
status: open
title: Recursive directory list with pathlib.Path.iterdir
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36602>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to