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

Discussion in 'Python' started by MRAB, Aug 16, 2012.

  1. MRAB

    MRAB Guest

    On 16/08/2012 01:28, Tim Chase wrote:
    > 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.
    >

    +1
     
    MRAB, 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:
    177
    Ethan Furman
    Jul 6, 2012
  2. Ethan Furman
    Replies:
    7
    Views:
    177
    Ethan Furman
    Aug 16, 2012
  3. Tim Chase
    Replies:
    0
    Views:
    127
    Tim Chase
    Aug 16, 2012
  4. Ethan Furman
    Replies:
    0
    Views:
    131
    Ethan Furman
    Aug 16, 2012
  5. Tim Chase
    Replies:
    0
    Views:
    145
    Tim Chase
    Aug 16, 2012
Loading...

Share This Page