Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-02 Thread Nikolaus Rath
Ben Hoyt writes: > Thanks for the clarifications and support. > >> Ah, the wording in the PEP says "Linux, Windows, OS X". Superficially, >> that said "everywhere" to me. It might be worth calling out >> specifically some examples where it's not available without an extra >> system call, just to m

Re: [Python-Dev] PEP 471: scandir(fd) and pathlib.Path(name, dir_fd=None)

2014-07-02 Thread Charles-François Natali
> 2014-07-02 12:51 GMT+02:00 Charles-François Natali : >> I don't think we should support it: it's way too complicated to use, >> error-prone, and leads to messy APIs. > > Can you please elaborate? Which kind of issue do you see? Handling the > lifetime of the directory file descriptor? Yes, among

Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-02 Thread Ben Hoyt
Thanks for the clarifications and support. > Ah, the wording in the PEP says "Linux, Windows, OS X". Superficially, > that said "everywhere" to me. It might be worth calling out > specifically some examples where it's not available without an extra > system call, just to make the point explicit.

Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-02 Thread Paul Moore
tl;dr - I agree with your points and think that the original PEP 471 proposal is fine. The details here are just clarification of why my proposal wasn't just "use PEP 471 as written" in the first place... On 2 July 2014 13:41, Ben Hoyt wrote: > 1) It's a nasty API to actually write code with. If

Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-02 Thread Ben Hoyt
Thanks for the effort in your response, Paul. I'm all for KISS, but let's just slow down a bit here. > I think that thin wrapper is needed - even > if the various bells and whistles are useful, they can be built on top > of a low-level version (whereas the converse is not the case). Yes, but API

Re: [Python-Dev] PEP 471: scandir(fd) and pathlib.Path(name, dir_fd=None)

2014-07-02 Thread Victor Stinner
2014-07-02 12:51 GMT+02:00 Charles-François Natali : > I don't think we should support it: it's way too complicated to use, > error-prone, and leads to messy APIs. Can you please elaborate? Which kind of issue do you see? Handling the lifetime of the directory file descriptor? You don't like the

Re: [Python-Dev] PEP 471: scandir(fd) and pathlib.Path(name, dir_fd=None)

2014-07-02 Thread Charles-François Natali
2014-07-01 8:44 GMT+01:00 Victor Stinner : > > IMO we must decide if scandir() must support or not file descriptor. > It's an important decision which has an important impact on the API. I don't think we should support it: it's way too complicated to use, error-prone, and leads to messy APIs.

Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-02 Thread Jonas Wielicki
On 01.07.2014 23:20, Paul Moore wrote: > [snip] > Please, let's stick to a low-level wrapper round the OS API for the > first iteration of this feature. Enhancements can be added later, when > real-world usage has proved their value. > > Paul +1 to the whole thing. That’s an ingeniously simple so