dbf.py API question concerning Index.index_search()
Tim Chase
python.list at tim.thechases.com
Wed Aug 15 20:28:31 EDT 2012
On 08/15/12 19:21, Ethan Furman wrote:
> The well-hidden clue was this line:
>
> nearest returns where the match should be instead of raising an error
>
> And my question should have been:
>
> What should the return value be when nearest == True?
Ah, well that's somewhat clearer. Return the closest and not bother
to let the user know it was inexact. Upon requesting it with
nearest=True, they *knew* that the result might be a nearest match.
Though if they ask for nearest, an exact match *better* be the
nearest if it exists. :-P
I'd say the API-user shouldn't ask for what they don't want.
-tkc
More information about the Python-list
mailing list