[Python-ideas] find-like functionality in pathlib

Wes Turner wes.turner at gmail.com
Mon Dec 28 19:50:11 EST 2015


On Dec 28, 2015 2:33 PM, "Chris Barker" <chris.barker at noaa.gov> wrote:
>
> On Tue, Dec 22, 2015 at 4:23 PM, Guido van Rossum <guido at python.org>
wrote:
>>
>> The two-level iteration forced upon you by os.walk() is indeed often
unnecessary -- but handling dirs and files separately usually makes sense,
>
>
> indeed, but not always, so a simple API that allows you to get a flat
walk would be nice....

The path.py .walk* APIs work great w/ fnmatch:

https://pythonhosted.org/path.py/api.html#path.Path.walk

https://pythonhosted.org/path.py/api.html#path.Path.walkdirs

https://pythonhosted.org/path.py/api.html#path.Path.walkfiles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151228/5f2eca72/attachment-0001.html>


More information about the Python-ideas mailing list