[wingide-users] Helping WindIDE know list contents

Wingware Support support at wingware.com
Tue May 6 09:36:22 MDT 2008


Rex Turnbull wrote:
> Is there a way to help WingIDE know the intended contents of a list?
> 
> Each time I find myself writing a loop with the isinstance helper
> for bar in self.bars:
>    assert isinstance(elem, Bar)
>    ...
> 
> Most often this would be a help for me when I use classes with lists of 
> other classes with lists of even other classes. Example:
> class Foo:
>    def __init__(self, barlist):
>        assert islistof(barlist, Bar) <-- something like this would be 
> helpful
>        self.bars = barlist
> 
> I know that lists can have all kinds of objects, but in the classes I 
> use they are pretty straightforward. The code completion in WingIDE 
> speeds me up so much, that I really miss it in these cases. I am also 
> willing to use a more restrictive list-derivative if this makes coding 
> faster and isn't too hungry for performance time.

Currently, Wing's analysis engine is ignoring the type of list contents.
That's one area we want to improve things in the future, among other
such cases.

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list