Python editor example with auto-complete?

holger krekel pyth at devel.trillke.net
Thu Dec 12 05:16:26 EST 2002


Neil Hodgson wrote:
> holger krekel:
> 
> > If you are inside an editor you are *not* in the runtime environment
> > of the program.   Parsing python syntax gets you no clue
> > about the actual objects and its type.  That's why it is called
> > 'dynamic typing'.  Not static type declaration: it is not enough
> > for an editor to only parse source code to get to autocompletion
> > information.  It requires *execution* in order to know which
> > object a name refers to.
> 
>    An editor can usefully provide autocompletion for the standard modules.
> Type "urllib." and  see the functions available: [socket, splithost, etc. ].

But obviously this doesn't work in the general case.  Of course, it's good 
and helpful if editors at least provide some heuristics for autocompletion
at least for some modules.  Note, that it gets a lot harder for the editor
to find completions on

    def myfunc():
        smtp = smtplib.SMTP()
        smtp.<tab>

or even

    def myfunc(smtp_object):
        smtp_object.<tab>

without having runtime information. 

    holger




More information about the Python-list mailing list