Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

The code with using scandir() is more complex and is different enough from the 
code with using listdir() for having significant risk of introducing bugs. Also 
using scandir() introduces a risk of leaking file descriptors.

We don't rewrite the code without good reasons. If you propose performance 
enhancement, please provide benchmark results that expose the benefit of this 
change. If it is not large enough, it is not worth to do.

Actually your change looks making the code slower: it reads the directory twice.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to