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

Any optimization can be accepted only when we have any prove that the change 
actually has measurable effect, and that it is large enough.

Avoiding calling list() on the output of scandir() may be not harmless. For 
example it will left open a file descriptor. This can cause issues if walk a 
deep tree, especially if do this in few threads simultaneously. list() 
guaranties that it is open in very limited time (although using a context 
manager is desirable).

----------

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

Reply via email to