Re: Suggesting methods with similar names

2005-04-02 Thread bearophileHUGS
Is that last idea so stupid? Still, I'd like to know if you know some little Python search engines for such purpose. Thank you, Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggesting methods with similar names

2005-04-01 Thread bearophileHUGS
Suggesting method names based on a wrong method name can be useful, but I think the smart help can be improved: it can also be useful to have a suggestion for method names on the basis on a short description (or keywords) about what I want to do to/with the object. Maybe some people here can give

Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
I have a class Surface with many methods. Working in the interactive window I receive an error like this when I write the wrong method name: table.addGlas() Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'Surface' object has no attribute 'addGlas' Is it possibile

Re: Suggesting methods with similar names

2005-03-30 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: I have a class Surface with many methods. Working in the interactive window I receive an error like this when I write the wrong method name: table.addGlas() Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'Surface' object has no

Re: Suggesting methods with similar names

2005-03-30 Thread Terry Reedy
You could achieve this by overriding __getattribute__ (untested): I believe OP would do better to use __getattr__, which is only called when the attribute is not found by the normal lookup, which is the only time he needs/wants customized control. TJR --

Re: Suggesting methods with similar names

2005-03-30 Thread Raymond Hettinger
[Bearophile] Working in the interactive window I receive an error like this when I write the wrong method name: table.addGlas() Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'Surface' object has no attribute 'addGlas' Is it possibile to make the object

Re: Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
Raymond HettingerWhen you're done, consider posting the result as an ASPN cookbook recipe. I still cannot write in the cookbook... I think I have problems with the registration. So you can put it there... I've found that difflib is good enough for the string matching. This idea isn't fully mine,

Re: Suggesting methods with similar names

2005-03-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: I have a class Surface with many methods. Working in the interactive window I receive an error like this when I write the wrong method name: table.addGlas() Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'Surface' object has no

Re: Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
Diez B. Roggischit will make an object return always _something_ - and thus you don't catch misspellings in non-interactive Uhm, I'm sorry, I don't understand you. If you look at the code I've just posted, you can see that it still raises AttributeError, the difference is just the error

Re: Suggesting methods with similar names

2005-03-30 Thread Bengt Richter
On Wed, 30 Mar 2005 17:55:32 GMT, Raymond Hettinger [EMAIL PROTECTED] wrote: [Bearophile] Working in the interactive window I receive an error like this when I write the wrong method name: table.addGlas() Traceback (most recent call last): File stdin, line 1, in ? AttributeError: