Open jbylund opened 2 years ago
@notatallshaw this is the other possibility I mentioned. Let me know if you think this would mesh well with your ideas for backtracking in the future?
This approach LGTM if maintainers want the logic of processing the causes to remain on the downstream library side.
And I continue to really prefer avoiding a cache that depends on the ids of mutable objects (even if they are carefully used).
I guess let's just see what maintainers think.
I think #93 would supercede this now?
I think #93 would supercede this now?
My opinion is that this option would allow for:
Sounds like a provider function is also a fit for those reasons? If the consumer wishes, it can simply implement the function to return a set, or whatever built-in or custom type that suits the need.
Sounds like a provider function is also a fit for those reasons? If the consumer wishes, it can simply implement the function to return a set, or whatever built-in or custom type that suits the need.
But I think we need this "hook" to allow the provider to inject such a function?
Add a prepare attribute to the Resolution object which is called on backtrack causes before passing that to
_get_preference
. This allows providers to operate over a processed version of backtrack_causes without having to implement a cache consumer side (which can be "yucky").