Message237757
My suggestion to add a new walk_dirs list is wrong: os.walk() documentation explicitly says that the dirs list can be modified to delete some directories:
https://docs.python.org/dev/library/os.html#os.walk
"""
When topdown is True, the caller can modify the dirnames list in-place (perhaps using del or slice assignment), and walk() will only recurse into the subdirectories whose names remain in dirnames; this can be used to prune the search, impose a specific order of visiting, or even to inform walk() about directories the caller creates or renames before it resumes walk() again.
"""
os_walk_1.patch is inefficient: it also calls entry.is_symlink() for file entries.
I reworked your patch to only call is_symlink() for directories.
Thanks for the patch Ben. I think that we are now done with the PEP 471 no? Maybe some doc changes (I'm now reviewing your doc change in issue #22524). |
|
Date |
User |
Action |
Args |
2015-03-10 12:26:55 | vstinner | set | recipients:
+ vstinner, scott.dial, benhoyt, python-dev |
2015-03-10 12:26:55 | vstinner | set | messageid: <1425990415.13.0.447937017487.issue23605@psf.upfronthosting.co.za> |
2015-03-10 12:26:55 | vstinner | link | issue23605 messages |
2015-03-10 12:26:54 | vstinner | create | |
|