Message185167
Here's is an os.scandir(path='.') implementation that iterates reading the directory on the fly instead of pre-building a list.
os.listdir's implementation should ultimately be replaced by this as:
def listdir(path=None):
if path is None:
return list(os.scandir())
return list(os.scandir(path))
Though I have not yet done that in this patch so that I could compare behavior of old vs new.
Why the scandir name? Read the libc scandir man page. It fits.
I have tested this on POSIX (Linux). I don't have any ability to build Windows code so I expect that still has bugs and possibly compilation issues. Please leave comments on the 'review' link. |
|
Date |
User |
Action |
Args |
2013-03-24 22:56:28 | gregory.p.smith | set | recipients:
+ gregory.p.smith, loewis, terry.reedy, pitrou, giampaolo.rodola, tim.golden, eric.araujo, Trundle, brian.curtin, torsten, nvetoshkin, neologix, socketpair, serhiy.storchaka |
2013-03-24 22:56:27 | gregory.p.smith | set | messageid: <1364165787.92.0.668426020222.issue11406@psf.upfronthosting.co.za> |
2013-03-24 22:56:27 | gregory.p.smith | link | issue11406 messages |
2013-03-24 22:56:27 | gregory.p.smith | create | |
|