New submission from Mikhail <tetele...@mail.ru>:

Hello! This is a very useful feature when a Path-object gets a list (or 
generator, as it is now) of files/dirs in self.dir, I think. Right now this is 
the .iterdir() function, but sometimes you only need `dirs` of that path (for 
example, I really needed the function when I was working with images for 
classification), and at the moment this is only solved by (path for path in 
root.iterdir() if path.is_dir()). You could make separate functions for this, 
but I suggest just adding the only_dirs/only_files(/only_links) flags to 
.iterdir().

----------
components: Library (Lib)
messages: 394064
nosy: tetelevm
priority: normal
severity: normal
status: open
title: Add flags or function in pathlib.Path
versions: Python 3.10

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

Reply via email to