You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as_path() - Context manager that guarantees the resource is an existing Path
cached() - Guarantees the resource is an existing Path throughout the program life
This reflects that we're really just wrapping the importlib.resources API along with an interpreter-lifetime cache, but if part of the reason to use this is to file the edges off of IR, maybe we should think a little more abstractly. We could instead write these as:
ephemeral() - The data is accessible with a limited interface
temporary() - The data is temporarily accessible with a full interface
permanent() - The data is permanently accessible with a full interface
Perhaps this would be clearer to somebody who isn't already in the weeds of IR and just wants to understand the semantics of our loader?
Also, do we think it's worth keeping the __call__() behavior as the safe-but-potentially-wasteful cached()/permanent(), or remove it and always be explicit?
The text was updated successfully, but these errors were encountered:
Right now, we have three methods:
readable()
- Guarantees the resource is readableas_path()
- Context manager that guarantees the resource is an existing Pathcached()
- Guarantees the resource is an existing Path throughout the program lifeThis reflects that we're really just wrapping the
importlib.resources
API along with an interpreter-lifetime cache, but if part of the reason to use this is to file the edges off of IR, maybe we should think a little more abstractly. We could instead write these as:ephemeral()
- The data is accessible with a limited interfacetemporary()
- The data is temporarily accessible with a full interfacepermanent()
- The data is permanently accessible with a full interfacePerhaps this would be clearer to somebody who isn't already in the weeds of IR and just wants to understand the semantics of our loader?
Also, do we think it's worth keeping the
__call__()
behavior as the safe-but-potentially-wastefulcached()
/permanent()
, or remove it and always be explicit?The text was updated successfully, but these errors were encountered: