def coerce_view(self, view):
    if ((type(view) is str) or isinstance(view, pathlib.Path)):
        return self._view_type(view, mode='r')
    if isinstance(view, self._view_type):
        return self._view_type(view.path, mode='r')
    return view
def coerce_view(self, view):
    if ((type(view) is str) or isinstance(view, pathlib.Path)):
        return self._view_type(view, mode='r')
    if isinstance(view, self._view_type):
        return self._view_type(view.path, mode='r')
    return view