[wingide-users] auto-completion doesn't work

Wingware Support support at wingware.com
Mon Aug 4 08:33:32 MDT 2008


Bryan wrote:
> i installed lxml and when i type the dot on the last line of the
> following code snippet, wing says in the code assistant that it cannot
> determine the type, so no popup box is displayed showing the
> attributes of tree.  we were about to buy wing for all our python
> developers, but this preventing us from buying wing at this time.
> anything it can do to make this work?
> 
> from lxml import etree
> 
> tree = etree.fromstring('<html>hello</html>')
> tree.    # <--- no auto-completion popup box here

The issue here is that this is all written in C (via Cython) and Wing
can't see into C code to determine the type of the return value of
etree.fromstring.  This will be true of many other things in lxml.
We do 'scrape' the extension modules successfully, it appears, but
there are limits to what you can get out of an extension module.

A work-around would be to do something like this:

tree = etree.fromstring('<html>hello</html>')
isinstance(tree, etree._Element)
tree.

(Note I'm guessing what the correct type is)

However, since this affects much of lxml, this may be tedious if you
have many places like this.

You may be better off working in Wing's Python Shell and/or Debug Probe,
where you will get real runtime-sourced data type analysis and thus
auto-completion will work on the above and other cases like it.

Wing's editor shows what it can find without executing your code at all
(by design since code is often broken, or can even do harmful things).

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list