Skip to content

Commit

Permalink
update docs of get_preference
Browse files Browse the repository at this point in the history
  • Loading branch information
notatallshaw committed Aug 3, 2024
1 parent 23cd488 commit 3818c77
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/resolvelib/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def get_preference(
) -> Preference:
"""Produce a sort key for given requirement based on preference.
As this is a sort key it will be called O(n) times per backtrack step,
where n is the number of `identifier`s. If you have a check which is
expensive in some sense, e.g. it needs to make O(n) checks per
identifier, or takes significant wall clock time but could be short
circuited once finding an identifier that matches the check, consider
using `narrow_requirement_selection` to filter the `identifier`s
before this sort key is called.
As this is a sort key it will be called O(n) times per backtrack
step, where n is the number of `identifier`s. If you have a check
which is expensive in some sense, e.g. it needs to make O(n) checks
per call, or takes significant wall clock time but could be
short-circuited once finding an identifier that matches the check,
consider using `narrow_requirement_selection` to filter the
`identifier`s before this sort key is called.
The preference is defined as "I think this requirement should be
resolved first". The lower the return value is, the more preferred
Expand Down

0 comments on commit 3818c77

Please sign in to comment.