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

Re: Suggesting methods with similar names

2005-03-30 Thread Terry Reedy
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > BTW, when are we going to be able to write > > @classdeco > class Foo(object): That possibility is currently being discussed for 2.5 on the pydev list. There are mixed opinions, none yet from Guido that I noticed. Te

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 "", line 1, in ? >> Attr

Re: Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
Diez B. Roggisch>it 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 message.

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 "", line 1, in ? > AttributeError: 'Surface' object has no

Re: Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
Raymond Hettinger>When 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 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 "", line 1, in ? > AttributeError: 'Surface' object has no attribute 'addGlas' > > Is it possibile to make the ob

Re: Suggesting methods with similar names

2005-03-30 Thread bearophileHUGS
Thank you, __getattr__ does what I need :-) A smart help can be designed easely... Bear hugs, Bearophile -- http://mail.python.org/mailman/listinfo/python-list

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 -- http://mail.python.org/mailman/lis

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 "", line 1, in ? > AttributeError: 'Surface' object has no

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 "", line 1, in ? AttributeError: 'Surface' object has no attribute 'addGlas' Is it possibile t