[Python-3000] Removal of os.path.walk

Giovanni Bajo rasky at develer.com
Tue May 6 13:41:27 CEST 2008


On Thu, 01 May 2008 08:58:22 -0700, Guido van Rossum wrote:

> On Thu, May 1, 2008 at 3:20 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>  I think Giovanni's point is an important one as well - with an
>>  iterator,
>> you can pipeline your operations far more efficiently, since you don't
>> have to wait for the whole directory listing before doing anything
>> (e.g. if you're doing some kind of move/rename operation on a
>> directory, you can start copying the first file to its new location
>> without having to wait for the directory read to finish).
>>
>>  Reducing the startup delays of an operation can be a very useful thing
>>  when
>> it comes to providing a user with a good feeling of responsiveness from
>> an application (and if it allows the application to more effectively
>> pipeline something, there may be an actual genuine improvement in
>> responsiveness, rather than just the appearance of one).
> 
> This sounds like optimizing for a super-rare case. And please do tell me
> if you've timed this.

I do, it's easy. I have several Maildir directories with tens thousands 
of messages who take 10-15 seconds to be listed through NFS (starting 
from a ext3 file system). On the contrary, commands like "grep -r 
"whatever" ." start displaying output immediately.

Without something like opendir(), it's basically making impossible to 
achieve this in Python.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com



More information about the Python-3000 mailing list