Re: Pruning with os.scandir?

2015-08-06 Thread Stephen Kennedy
> I think you misunderstood. scandir() is the generator-producing equivalent > of listdir() which returns a list. Neither of them recurses into > subdirectories: Ah great, that makes sense. An article I read gave the impression that os.scandir() was replacing os.walk(), not simply being used i

Re: Pruning with os.scandir?

2015-08-06 Thread Peter Otten
Stephen Kennedy wrote: > I just saw PEP 471 announced. Mostly it looks great! One thing I found > puzzling though is the lack of control of iteration. With os.walk, one can > modify the dirs list inplace to avoid recursing into subtrees (As > mentioned somewhere, in theory one could even add to th

Pruning with os.scandir?

2015-08-06 Thread Stephen Kennedy
I just saw PEP 471 announced. Mostly it looks great! One thing I found puzzling though is the lack of control of iteration. With os.walk, one can modify the dirs list inplace to avoid recursing into subtrees (As mentioned somewhere, in theory one could even add to this list though that would be