Skip to content

Commit

Permalink
Add compatibility for Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 11, 2020
1 parent 09786d6 commit b7e0288
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions importlib_resources/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,23 @@ def package(self):
"""

@abc.abstractmethod
def children(self) -> List['SimpleReader']:
def children(self):
# type: () -> List['SimpleReader']
"""
Obtain an iterable of SimpleReader for available
child containers (e.g. directories).
"""

@abc.abstractmethod
def resources(self) -> List[str]:
def resources(self):
# type: () -> List[str]
"""
Obtain available named resources for this virtual package.
"""

@abc.abstractmethod
def open_binary(self, resource) -> BinaryIO:
def open_binary(self, resource):
# type: (str) -> BinaryIO
"""
Obtain a File-like for a named resource.
"""
Expand Down Expand Up @@ -200,7 +203,8 @@ class ResourceContainer(Traversable):
Traversable container for a package's resources via its reader.
"""

def __init__(self, reader: SimpleReader):
def __init__(self, reader):
# type: (SimpleReader) -> None
self.reader = reader

def is_dir(self):
Expand Down

0 comments on commit b7e0288

Please sign in to comment.