Comment 5 for bug 244677

Revision history for this message
Robert Kern (robert-kern) wrote : Re: IPython calls an object's __getattr__ inconsistently

To be clear, this is the output:

In [10]: %autocall
Automatic calling is: Smart

In [11]: f.myfunc()
Getting 'myfunc()'
myfunc()

Note that attribute being requested is 'myfunc()', not 'myfunc', so the rules about when __getattr__ gets called are being obeyed.

But yes, %autocall is risky. We could probably do a better parsing of the name and avoid going through ofind() if the name isn't just a valid.python.dotted name.