filesystem_spec
filesystem_spec copied to clipboard
Correctly handle maxdepth kwarg
As identified in discussion of PR #1128, maxdepth kwarg that is used in walk and related functions can be improved in two ways:
- Raise as an error if
maxdepth < 0. maxdepth=0should be handled differently tomaxdepth=1.
Is maxdepth=0 useful for anything?
It is supported in command line find where it does the somewhat counterintuitive find only within the supplied filename arguments. I've never had a real world use case for this. So one could argue that we should keep it for consistency with command line find, or we could simply disallow it because it is mostly useless?
Let's get rid of it!
Happily!