Skip to content
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

Rename Paths to Files #23

Open
Masynchin opened this issue Jul 30, 2022 · 0 comments
Open

Rename Paths to Files #23

Masynchin opened this issue Jul 30, 2022 · 0 comments

Comments

@Masynchin
Copy link
Owner

Paths are either directory or file, but our Paths contains only files. For example, ExtensionPaths can operate only at files, but this is not marked anyhow. Instead, it should be File and Files interfaces, and no Paths.

ndnt/ndnt/paths.py

Lines 32 to 43 in 091c121

class ExtensionPaths(Paths):
"""Extension paths.
Paths with certain extension.
"""
def __init__(self, origin: Paths, extension: Extension):
self.origin = origin
self.extension = extension
def __iter__(self) -> Iterable[Path]:
return filter(lambda path: self.extension == path.suffix, self.origin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant