[IPython-dev] ShellChannel.object_info equivalent?
Carlos Córdoba
ccordoba12 at gmail.com
Thu May 7 16:35:26 EDT 2015
Hi,
We were doing a similar thing in Spyder. Our solution was to:
1. Remove ANSI escape characters from the information returned by
IPython (there is regex for that in the qt frontend).
2. Extract signatures using another regex. This is not that hard because
there's a special line in IPython info for signatures.
We're only showing signatures, but it shouldn't be hard to extract
docstrings too following the same procedure :-)
Cheers,
Carlos
El 06/05/15 a las 21:52, Dino Viehland escribió:
> We use it to provide signature help inside of PTVS. By breaking out
> the arguments we can highlight the current arg that the user is
> typing. And we would display the doc string below the signature help.
>
> If it was available under a separate mime type that'd be great and
> we'd start displaying it again. For now we're just displaying the
> entire string which is a slightly degraded experience vs IPython 2 as
> well as our normal IDE experience.
> ------------------------------------------------------------------------
> From: Thomas Kluyver <mailto:takowl at gmail.com>
> Sent: 5/6/2015 9:49 AM
> To: IPython developers list <mailto:ipython-dev at scipy.org>
> Subject: Re: [IPython-dev] ShellChannel.object_info equivalent?
>
> Hi Dino,
>
> On 5 May 2015 at 13:06, Dino Viehland <dinov at microsoft.com
> <mailto:dinov at microsoft.com>> wrote:
>
> Is there a new equivalent to ShellChannel.object_info in 3.0+? I
> see that there’s now a KernelClient.inspect that seems similar but
> it doesn’t return the information at the same level of granularity
> – previously we’d get back the doc string, args, var args, var kw,
> and defaults. Now it seems like the reply just includes a textual
> representation without any of the information broken out.
>
> Is there any way to get the more detailed information?
>
>
> No, object_info was replaced with inspect. We decided to replace the
> structured data with text because a lot of the structured data was
> defined in a Python specific way, and it would have been hard to make
> it all language agnostic. What are you trying to use it for? We may be
> able to work out another way to do it, or add back a limited amount of
> structured information.
>
> Thanks,
> Thomas
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150507/07696457/attachment.html>
More information about the IPython-dev
mailing list