[IPython-dev] Proposal for small change in dir2() function to handle XMLRPC Server Proxies
Marco Nawijn
nawijn at gmail.com
Fri Oct 12 14:47:17 EDT 2012
On Fri, Oct 12, 2012 at 1:25 PM, Thomas Kluyver <takowl at gmail.com> wrote:
> On 11 October 2012 15:03, Marco Nawijn <nawijn at 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
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
Hi Thomas,
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,
Marco
More information about the IPython-dev
mailing list