Re: dbf.py API question concerning Index.index_search()

Discussion in 'Python' started by Tim Chase, Aug 16, 2012.

  1. Tim Chase

    Tim Chase Guest

    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
     
    Tim Chase, Aug 16, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ethan Furman

    API design question for dbf.py

    Ethan Furman, Jul 6, 2012, in forum: Python
    Replies:
    0
    Views:
    168
    Ethan Furman
    Jul 6, 2012
  2. Ethan Furman
    Replies:
    7
    Views:
    169
    Ethan Furman
    Aug 16, 2012
  3. Tim Chase
    Replies:
    0
    Views:
    118
    Tim Chase
    Aug 16, 2012
  4. Ethan Furman
    Replies:
    0
    Views:
    124
    Ethan Furman
    Aug 16, 2012
  5. MRAB
    Replies:
    0
    Views:
    150
Loading...

Share This Page