<p dir="ltr"><br>
On 23 Jul 2014 02:18, "Victor Stinner" <<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>> wrote:<br>
><br>
> 2014-07-22 17:52 GMT+02:00 Ben Hoyt <<a href="mailto:benhoyt@gmail.com">benhoyt@gmail.com</a>>:<br>
> > However, given that we have to support this for listdir() anyway, I<br>
> > think it's worth reconsidering whether scandir()'s directory argument<br>
> > can be an integer FD. Given that listdir() already supports it, it<br>
> > will almost certainly be asked for later anyway for someone who's<br>
> > porting some listdir code that uses an FD. Thoughts, Victor?<br>
><br>
> Please focus on what was accepted in the PEP. We should first test<br>
> os.scandir(). In a few months, with better feedbacks, we can consider<br>
> extending os.scandir() to support a file descriptor. There are<br>
> different issues which should be discussed and decided to implement it<br>
> (ex: handle the lifetime of the directory file descriptor).</p>
<p dir="ltr">As Victor suggests, getting the core version working and incorporated first is a good way to go. Future enhancements (like accepting a file descriptor) and refactorings (like eliminating the code duplication with listdir) don't need to (and hence shouldn't) go into the initial patch.</p>

<p dir="ltr">Cheers,<br>
Nick.<br></p>
<p dir="ltr">><br>
> Victor<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>