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
pathlib: iterfiles() and iterdirs() #63966
Comments
From my personal experience, listing all real files and all subdirectories in a directory is a very common use case. Here's a patch that adds the |
See also issue bpo-11406 which is more generic. |
Beta is out, so this issue must be targeted for 3.5. |
Having an |
Here is a patch with the proposed API. The API for convenience: def files(self, include_symlinks=True):
"""Iterate over the regular files in this directory.
"""
def subdirs(self, include_symlinks=True):
"""Iterate over the subdirectories in this directory.
""" |
Why not implement this pattern with def dirs(pattern)
and
def files(pattern) where both are a simple shortcut for ? |
I'm -1 on this: |
I agree with @barneygale, and there's been no activity on this issue in >8 years, signalling there isn't truly much of a need for this. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: