[docs] [issue13779] os.walk: bottom-up
report at bugs.python.org
Mon Jan 16 15:34:46 CET 2012
Zbyszek Szmek <zbyszek at in.waw.pl> added the comment:
I think that the documentation is pretty clear ("[if topdown=False] ... the directories in dirnames have already been generated by the time dirnames itself is generated"). And such behaviour is what one would expect, since it is the result of the simplest implementation (listdir(), yield <subdir>, yield <subdir>, yeild <subdir>, yeild <dir>).
I don't think that the implementation will be changed, since it is pretty to do listdir() yourself if needed, and it would make the function slower for the common use case.
Improving the documentation is always possible, what sentence would you see added (what would make the behaviour clearer to you?) ?
Python tracker <report at bugs.python.org>
More information about the docs