'Intellisense' possible for Python?

Greg Brunet gbrunet at nospamsempersoft.com
Thu Dec 19 01:28:30 EST 2002


"Patrick W" <patrickw106 at yahoo.com.au> wrote in message
news:87ptryn0ee.fsf at key.localdomain...
> "Greg Brunet" <gbrunet at nospamsempersoft.com> writes:
>
> > What I'm looking for are ways that the IDE can help me out - simple
> > stuff, like:
>
> > - When I can't remember the exact names of all of the methods or
> > properties of a class, it's nice if they pop up when I type
"object." so
> > I can scan through them to find the one I'm looking for.
>
> The interactive interpreter offers these facilities with 'dir' and
> 'help'.
>
> E.g.:
>
> >>> x = range(10)
> >>> dir(x)
> ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
> '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__',
> '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__',
> '__imul__', '__init__', '__le__', '__len__', '__lt__', '__mul__',
> '__ne__', '__new__', '__reduce__', '__repr__', '__rmul__',
> '__setattr__', '__setitem__', '__setslice__', '__str__', 'append',
> 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse',
> 'sort']
>
> >>> help(x.insert)
> Help on built-in function insert:
>
> insert(...)
>     L.insert(index, object) -- insert object before index


That's pretty cool & getting closer to what I was looking for - but
still not as clean or easy to use (for one thing: the dir command in
PythonWin returns a very long single line string).  I also noticed that
if I type "x.insert(" [at least in PythonWin's interactive window], a
tooltip for the insert method pops up with arguments & a brief comment.
Not quite as nice as the help you get from Intellisense, but still good.
After playing around with the script editor window, I see that it
provides some information as well, but not as much.  If I enter
"y=range(", then it displays the tooltip like in the interactive window,
but if I enter "y." I don't get a listbox of methods/properties.  OTOH,
if after entering the above info in an interactive window, I enter "x."
in the script editor window, then I do get the listbox.  So it evidently
bases that logic on the variable values in current session.  Once the
script has been run, then "y." DOES cause a listbox to appear.  Another
strange thing is that all of the methods are appearing twice in the
listbox! I also checked this out in Boa Constructor's editor, and it
doesn't provide this much feedback - bummer, since it seems like a
pretty nice environment!

I understand the reason for the overall limitation - Python's dynamic
typing ability.  I also understand that being able to provide some
enhanced help capabilities is not a good enough reason to make changes
in Python, so I'm trying to understand what can be done within the
current framework to improve the IDE experience for developers.  It
sounds like about the only way to solve the problem is real-time/dynamic
analysis as described in the WingIDE product that Stephan mentioned.
Thanks for your input,


--
Greg





More information about the Python-list mailing list