-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature suggestion: walk #35
Comments
This feature only works if the |
Personally I don't think it's good idea to call
|
Probably 4-tuples from |
I think you're overengineering :P But ok, let's concede the point: def walk(path, walker=os.walk):
for root, dirs, files, *rest in walker(path):
dirs[:] = [x for x in dirs if not ignored(x)]
files[:] = [x for x in files if not ignored(x)]
yield root, dirs, files, *rest this makes the API as clean as what I suggested, and supports fwalk, and will allow you to pass your own walker. |
@boxed Okay, sounds reasonable. Can you propose some tests? |
I get the feeling that a common use case for this lib would be to walk directory trees, ignoring stuff. I think it's easy to make a mistake that will lead to suboptimal performance when implementing this, and it feels a bit silly that everyone should write this.
I would propose adding a function
walk
:The text was updated successfully, but these errors were encountered: