arguably
arguably copied to clipboard
Graceful global state
Currently, arguably
is designed to only be run once. It might be useful to allow global state to persist. Doing so would require examining all the state in _context.Context
and figuring out a path to either automatically reset values (as with the ones that are only used for .run()
), or making a path allowing for items (functions, types, etc) to be re-added.
Allowing item to be re-added can cause a number of problems, as the item might have the same ID, but have its values be mutated. Additionally, when adding the same item, it can be added with different options (for example, a different alias).
More work will be needed to determine what issues could be caused by this. An alternative path would be to make arguably._context.context.reset()
a part of the supported API, exposing it through arguably.reset()
.
See #19