-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consumer passes in a prepare method which is called over backtrack causes #96
base: main
Are you sure you want to change the base?
Conversation
@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? |
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. |
But I think we need this "hook" to allow the provider to inject such a function? |
The pip side of this change would be this. |
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").