Justin Regele wrote:
actually, didn't quite do what i thought, now that I tested after I posted (doh!)

if you remove the '.__doc__' from the print, then yes you can actually see the attributes. the problem with the doc strings here is that they are all the same.

On Thu, Jun 11, 2009 at 1:12 PM, Justin Regele <[email protected] <mailto:[email protected]>> wrote:

    Could the intellisense be written in IronPython itself? Given
    pythons reflective nature, this could be very easy, and then the
    community could re-write how it behaves to suit wha they want.


    open up the console and do this

    #make a list, or whatever
    x=[]
    for attr in dir(x):
        print attr.__doc__


dir returns a list of strings. Here you are just printing the docstring of the string in the loop - string docstrings are unsurprising all the same...

See this code for how to fetch docstrings from object attributes. It's more fiddly than you would expect:

   http://www.voidspace.org.uk/python/weblog/arch_d7_2009_05_16.shtml#e1090

There's actually another corner case that code doesn't handle - where a descriptor shadows a name that also exists in the instance dictionary. This code will return the docstring from the object in the instance dictionary when it should return the descriptor docstring.

Of course none of this is really much help for intellisense where you need to do it from static analysis and not from live objects.

All the best,

Michael Foord





    On Thu, Jun 11, 2009 at 1:03 PM, Oleg Tkachenko
    <[email protected] <mailto:[email protected]>> wrote:

        This is totally can be done by the community + maybe some help
        from Dino if you hit any IPy issues. The VS interfaces are
        open and VS SDK includes IPy integration sample that contains
        simple intellisense implementation.

        --

        Oleg

        *From:* [email protected]
        <mailto:[email protected]>
        [mailto:[email protected]
        <mailto:[email protected]>] *On Behalf Of
        *Adam Brand
        *Sent:* Thursday, June 11, 2009 12:41 PM

        *To:* Discussion of IronPython
        *Subject:* Re: [IronPython] VS Support/Intelllisense for
        IronPython

        Is adding Intellisense for IPY to VS something that can be
        done by the community, or does it require access to source
        code that we can’t access?

        I’m not familiar with the extent to which VS can be customized
        for languages.

        Thanks,

        Adam

        Adam Brand

        SilverKey Technologies

        *From:* [email protected]
        <mailto:[email protected]>
        [mailto:[email protected]
        <mailto:[email protected]>] *On Behalf Of
        *Dino Viehland
        *Sent:* Thursday, June 11, 2009 11:18 AM
        *To:* Discussion of IronPython
        *Subject:* Re: [IronPython] VS Support/Intelllisense for
        IronPython

        We’ve made some attempts in the past (e.g. IronPython Studio)
        but there’s no longer any active development for intellisense.

        *From:* [email protected]
        <mailto:[email protected]>
        [mailto:[email protected]
        <mailto:[email protected]>] *On Behalf Of
        *Adam Brand
        *Sent:* Thursday, June 11, 2009 7:35 AM
        *To:* Discussion of IronPython
        *Subject:* [IronPython] VS Support/Intelllisense for IronPython

        I was wondering if there is any ongoing development to support
        Intellisense with IronPython in Visual Studio.

        Can someone from the team comment on this?

        Thanks,

        Adam


        _______________________________________________
        Users mailing list
        [email protected] <mailto:[email protected]>
        http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



------------------------------------------------------------------------

_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to