[Python-ideas] PEP471 - (os.scandir())

Andrew Barnert abarnert at yahoo.com
Fri Nov 27 13:42:31 EST 2015


On Nov 27, 2015, at 10:32, Paul Moore <p.f.moore at gmail.com> wrote:
> 
>> On 26 November 2015 at 23:22, Erik <python at lucidity.plus.com> wrote:
>> I have studied the PEP, followed a lot of the references and looked at the
>> 3.5.0 implementation. I can't see that I've missed such a thing already
>> existing, but it's possible. If so, perhaps this is instead a request to
>> make that thing more obvious somehow!
> 
> Does pathlib use scandir? If so, then maybe you get the caching
> benefits by using pathlib? And if pathlib doesn't use scandir, maybe
> it should? [I just checked, it looks like pathlib doesn't use scandir
> :-(]

Does pathlib even have a walk equivalent? (I know it has glob('**'), but that's not the same thing.)

Or are you suggesting that people should use path.iterdir with explicit recursion (or an explicit stack), and therefore just changing iterdir to use scandir (and prefill as many cached attribs as possible in each result) is what we want?


More information about the Python-ideas mailing list