[IPython-dev] Proposal for small change in dir2() function to handle XMLRPC Server Proxies

Thomas Kluyver takowl@gmail....
Fri Oct 12 06:25:31 CDT 2012


On 11 October 2012 15:03, Marco Nawijn <nawijn@gmail.com> wrote:
> I would to propose that a small change is made to the dir2() function
> in IPython to better handle tab completion on a xmlrpclib.ServerProxy
> object.

I've also run into this before, and I agree that we should handle it
better, but I don't think special casing xmlrpclib objects is the
answer. Apart from anything else, we don't want to import xmlrpclib in
every process just to check for it in tab completions.

>From IPython's end, I think we should do a better job of catching
exceptions raised in tab completion. But I think it's up to xmlrpclib
to make __dir__ work properly.

Note that this is already improved in Python 3 - the implementation of
dir() now looks up __dir__ in a way that doesn't go via __getattr__,
so it falls back to the standard dir() method.

Thomas


More information about the IPython-dev mailing list