From 3234977f785a3a121c9d805282804faeb5ed417f Mon Sep 17 00:00:00 2001 From: Damian Shaw Date: Sat, 3 Aug 2024 12:40:06 -0400 Subject: [PATCH] update docs of `get_preference` --- src/resolvelib/providers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/resolvelib/providers.py b/src/resolvelib/providers.py index cb148b8..7afcce7 100644 --- a/src/resolvelib/providers.py +++ b/src/resolvelib/providers.py @@ -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, which is applied 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