Skip to content

Conversation

FFY00
Copy link
Member

@FFY00 FFY00 commented May 28, 2024

Fixes #309

@FFY00
Copy link
Member Author

FFY00 commented Jun 26, 2024

@jaraco what do you think of this?

Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. We should add some tests to ensure the use-case is covered. And should we include type annotations?

@@ -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.

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

Successfully merging this pull request may close these issues.

Expose base paths of MultiplexedPath
2 participants