Skip to content

Commit a8a471c

Browse files
committed
2 parents 3d7d2aa + 680ab0f commit a8a471c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

importlib_resources/trees.py

+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ def __truediv__(self, child):
5959
Return Traversable child in self
6060
"""
6161

62+
@abc.abstractmethod
63+
def open(self, mode='r', *args, **kwargs):
64+
"""
65+
mode may be 'r' or 'rb' to open as text or binary. Return a handle
66+
suitable for reading (same as pathlib.Path.open).
67+
68+
When opening as text, accepts encoding parameters such as those
69+
accepted by io.TextIOWrapper.
70+
"""
71+
6272

6373
def from_package(package):
6474
"""Return a Traversable object for the given package"""

0 commit comments

Comments
 (0)