[Idle-dev] Small patch to AutoExpand.py

Markus Gritsch gritsch@iue.tuwien.ac.at
Thu, 02 Mar 2000 15:41:50 +0100


Guido van Rossum wrote:

> > [Mark Hammond]
> > > While using the auto-expand feature, it struck me that it really
> > > should also match against builtin names.
> > >
> > > Eg, if I enter "Index" and select auto-complete, IndexError should
> > > appear, even if it doesnt exist in the source file.
> > >
> > > Does anyone else agree?

> [Guido]
> By the way, there's a different distinction possible here.  Mark seems
> to be fond of features like call-tips and attribute-tips that pop up
> little yellow windows without asking.

I do too. Imagine you have an instance of a class which has, say about 30 set and
corresponding 30 get methods. If you want to go thru all this attributes by
pressing up to 60 times ALT-/ this would be annoying. In a attribute-tips pup up
I can scroll thru the various attributes with cursor or pg-up and pg-down keys
and can select on by typing RETURN or something.

>  I've met at least one user who
> turned off call-tips in IDLE, and I must say that it's a mixed
> blessing for me.  (Maybe it should disappear quicker?)

I think it's o.k. when there is an option to turn it on or off.

But I think Mark's idea was to include *builtin names* in a popup.

o.k. I will try to explain Forte4Java's completion and auto-completion features,
because this is a very professional looking IDE, and I think they have thought *a
lot* of how to improve the user-friendlyness.

Lets say I have already typed the following code:

class FooClass:
    def barMethod(self):
        print 'bar'

    def bazMethod(self, text):
        print text

myObject = FooClass()

now I type

myOb

and while having the cursor located after the b I press CTRL+SPC. Now a pup up is
shown with all the possible completions for myOb, in this case only 'myObject'
would be shown. By pressing enter the selected entry in the pup up window is
choosen and the pup up is closed. By pressing TAB myOb would be comleted as much
as possible, and the pup up stays.
Now I type a point:

myObject.

The pop up now shows all the properties of the object FooClass, and if FooClass
would be inherited from some other class, even the properties of the parent(s)
would be shown. Again I can select and choose on by pressing RETURN (the pop up
is closed), or I can complete as much as possible by pressing TAB (the pop up
remains).

The important thing is, that the pup up only pops up when I explicitly press
CTRL-SPC, or when I type a point after an object and wait some time. The pop up
can be closed at any time by pressing ESC.

And word completion (ALT+/ in Emacs) is available *separately* by another
key-combination. Word completion completes the word as much as possible, but
without showing a pop up window.

There is no difference between attribute-tip and call-tip. The arbument names are
shown together with the attributes. In the example above something like

myObject.
         +-----------------+
         | barMethod()     |
         | bazMethod(text) |
         +-----------------+

I hope this clearifys some things ...

Kind regards,
Markus

--
                                                                      |\/\/\/|
/------------------------------------------------------------------\  |      |
| Markus GRITSCH                 | phone:    +43 / 1 / 58801-36015 |  |      |
| Institute for Microelectronics | cellular: +43 / 676 / 4973431   |  | (o)(o)
| Technical University of Vienna | fax:      +43 / 1 / 58801-36099 |  C      _)
| Gusshausstrasse  27-29 / E360  | email: gritsch@iue.tuwien.ac.at |   | ,___|
| A-1040  Vienna / AUSTRIA       | SMS:   436764973431@max.mail.at |   |   /
\------------------------------------------------------------------/  /____\
                                                                     /      \
"Computers let you make more mistakes faster than any other invention in human
 history, with the possible exception of handguns and tequila."
                                                               Mitch Radcliffe