Closed notatallshaw closed 2 years ago
There are some architectural differences between the way I've implemented this and how Requirement
and Candidate
work.
@uranusjr if you get a chance some time let me know if this is what you were thinking or if I missed the shot and need to make some correction.
Upon some further thinking this approach is type unsafe, I need to study how other objects are implemented a bit better first.
Addresses comments made in https://github.com/sarugaku/resolvelib/pull/93#issuecomment-970470701
Provider now has a
causes
method that allows it to define what the causes object looks like.The returned object must implement the following:
copy.copy
For example if would be possible to implement the method like so to preserve the existing behavior (would work on Python 2.7 to 3.10):
There is an accompanying pip PR (https://github.com/pypa/pip/pull/10732) that leverages this new interface to resolve the performance issues described in https://github.com/pypa/pip/pull/10621
Need some hints / help defining a better type than "Any" for "causes" if that matters.