[Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

MRAB python at mrabarnett.plus.com
Fri Jun 27 01:28:20 CEST 2014


On 2014-06-26 23:59, Ben Hoyt wrote:
> Hi Python dev folks,
>
> I've written a PEP proposing a specific os.scandir() API for a
> directory iterator that returns the stat-like info from the OS, the
> main advantage of which is to speed up os.walk() and similar
> operations between 4-20x, depending on your OS and file system. Full
> details, background info, and context links are in the PEP, which
> Victor Stinner has uploaded at the following URL, and I've also
> copied inline below.
>
> http://legacy.python.org/dev/peps/pep-0471/
>
> Would love feedback on the PEP, but also of course on the proposal
> itself.
>
[snip]
Personally, I'd prefer the name 'iterdir' because it emphasises that
it's an iterator.


More information about the Python-Dev mailing list