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
"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
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
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.
[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
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,
[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
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
> 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
[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
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
12 matches
Mail list logo