Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions importlib_resources/readers.py
Original file line number Diff line number Diff line change
@@ -72,6 +72,10 @@ def __init__(self, *paths):
if not all(path.is_dir() for path in self._paths):
raise NotADirectoryError('MultiplexedPath only supports directories')

@property
def paths(self):
return self._paths.copy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we type-annotate this property to be a non-mutable Sequence, and because self._paths is not mutated internally (also treated like a non-mutable Sequence), there's no need to make a copy. But I'm okay either way.


def iterdir(self):
children = (child for path in self._paths for child in path.iterdir())
by_name = operator.attrgetter('name')