was Re: [PATCH] A compromise on case, now improved NameError, AttributeError

Shae Erisson shapr at uab.edu
Thu May 25 11:16:07 EDT 2000


Martin von Loewis wrote:

> I have two suggestions: In order to avoid hard-coding the error
> message, I recommend to put this code into NameError and
> AttributeError, like this:

<snip>

> Given an intelligent implemenentation of find_nearest_match, it could
> also detect other kinds of typos.
> 
> I'd love to see such a feature in standard Python.
> 
> Regards,
> Martin

yes! I completely agree! I don't know how spell-checkers work, but it
seems they would probably have a good implementation of
find_nearest_match. Once you have that, you just get all of the variable
names in the LGB scope and suggest the closest.

It would be wonderful to have in the standard python distro!
-- 
sHae mAtijs eRisson (sHae at wEbwitchEs.coM) gEnius fOr hIre
   bRing mE fIve sQuirrels aNd nO oNe wIll gEt hUrt
13:00pm up 1 season, 1 squirrel, load average: 1+1j 0.5+2j 0.2+0.5j



More information about the Python-list mailing list