[SciPy-Dev] requesting code review: added close matches to constants.codata.value()
Charles R Harris
charlesr.harris at gmail.com
Mon Apr 28 17:53:18 EDT 2014
On Mon, Apr 28, 2014 at 10:47 AM, Kevin Davies <kdavies4 at gmail.com> wrote:
> Thanks for everyone's help. It sounds like the best option is to add
> this recommendation system to constants.codata.find(). Please take a
> look:
> https://github.com/kdavies4/scipy/compare/codata-find
>
>
> On 04/28/2014 02:53 AM, Robert Kern wrote:
> > On Mon, Apr 28, 2014 at 1:48 PM, Pierre Haessig
> > <pierre.haessig at crans.org> wrote:
> >> Hi Kevin,
> >>
> >> Just a random thought: what about putting your recommendation system in
> >> a separate "search" function ?
> >> The KeyError raised by value(...) could be one-line message pointing to
> >> this search function.
> > The argument to KeyError should be the key that is causing the
> > problem, not a natural language message. That's why his attempt to use
> > a multi-line string got printed as its repr().
> >
> >> That function, meant to be used interactively unlike value(), could use
> >> prints I guess.
> > But yes, I agree that adding a function specifically documented to be
> > used interactively would be a better place for this functionality.
> >
>
Maybe just add something like a `suggestion` function which returns a list
of suggested keys. No need for a print statement, as the list will be
displayed on the terminal.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140428/7adb7748/attachment.html>
More information about the SciPy-Dev
mailing list