[wingide-users] Helping WindIDE know list contents

Rex Turnbull rex at dicad.de
Tue May 6 07:55:23 MDT 2008


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.

Thanks,
Rex


More information about the wingide-users mailing list