[New-bugs-announce] [issue44198] Add flags or function in pathlib.Path

Mikhail report at bugs.python.org
Thu May 20 16:56:21 EDT 2021


New submission from Mikhail <tetelev99 at 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 <report at bugs.python.org>
<https://bugs.python.org/issue44198>
_______________________________________


More information about the New-bugs-announce mailing list