This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barneygale
Recipients barneygale
Date 2020-03-09.00:17:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org>
In-reply-to
Content
`pathlib.Path.iterdir()` uses `os.listdir()` rather than `os.scandir()`. I think this has a small performance cost, per PEP 471:

> It returns a generator instead of a list, so that scandir acts as a true iterator instead of returning the full list immediately.

As `scandir()` is already available from `_NormalAccessor` it's a simple patch to use `scandir()` instead.
History
Date User Action Args
2020-03-09 00:17:57barneygalesetrecipients: + barneygale
2020-03-09 00:17:57barneygalesetmessageid: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org>
2020-03-09 00:17:57barneygalelinkissue39907 messages
2020-03-09 00:17:57barneygalecreate