[IPython-dev] Proposal for small change in dir2() function to handle XMLRPC Server Proxies
Fri Oct 12 13:47:17 CDT 2012
On Fri, Oct 12, 2012 at 1:25 PM, Thomas Kluyver <firstname.lastname@example.org> wrote:
> On 11 October 2012 15:03, Marco Nawijn <email@example.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
> 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.
> IPython-dev mailing list
I agree with you that it would be better to change the xmlrpc Proxy object
to better respond to __dir__, instead of changing dir2(). I will take a look at
it and see if I can come up with an elegant solution. It was just so cool to see
the code completion of the server side functionality from a client side terminal
just by making this small change :).
Thanks for the response and kind regards,
More information about the IPython-dev