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
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
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
[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
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
--
[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
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,
[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
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
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:
10 matches
Mail list logo