importlib.abc.ResourceLoader

class importlib.abc.ResourceLoader

An abstract base class for a loader which implements the optional PEP 302 protocol for loading arbitrary resources from the storage back-end.

abstractmethod get_data(path)

An abstract method to return the bytes for the data located at path. Loaders that have a file-like storage back-end that allows storing arbitrary data can implement this abstract method to give direct access to the data stored. OSError is to be raised if the path cannot be found. The path is expected to be constructed using a module’s __file__ attribute or an item from a package’s __path__.

Changed in version 3.4: Raises OSError instead of NotImplementedError.

doc_python
2016-10-07 17:34:37
Comments
Leave a Comment

Please login to continue.