[issue26032] Use scandir() to speed up pathlib globbing

Ben Hoyt report at bugs.python.org
Wed Jan 6 20:06:53 EST 2016


Ben Hoyt added the comment:

Guido, it's true that in almost all cases you get the speedup (no system call), and it's very much worth using. But the idea with the docs being non-committal is because being specific would make the docs fairly complex. I believe it's as follows for is_file/is_dir/is_symlink:

* no system call required on Windows or Unix if the entry is not a symlink
* unless you're on Unix with some different file system (maybe a network FS?) where d_type is DT_UNKNOWN
* some other edge case which I've probably forgotten :-)

Do you think the docs should try to make this more specific?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26032>
_______________________________________


More information about the Python-bugs-list mailing list