Serhiy Storchaka added the comment:

os.walk() allows more flexible control.

    for root, dirs, files in os.walk(top):
        if is_too_deep(root):
            dirs.clear()
            continue
        ...

You can even walk up to different depth on different parts of the tree. You can 
limit walking not by the directory depth, but by the length of the path, or the 
number of links in the path, or what-you-need. Adding separate parameters for 
all this particular cases is not practical.

I think there is a little need in this feature.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26781>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to