[wingide-users] Better ways to teach the SourceAssistant

Wingware Support support at wingware.com
Wed Jul 30 16:40:56 MDT 2008


Warren, Russell wrote:
> ...
> Which tells Wing to give me autocompletion on foo as if it were a bar
> (even if it isn't).  This is indispensable to me, but I do get tired of
> it sometimes.  One tiresome case I can think of is when repeatedly using
> a common function that only returns one type.  It would be nice if:
> 
> 1) Wing knew the return types of the functions in the standard library
>  - eg: that os.listdir returns a list
> 
> 2) There were additional "teaching aids" available to educate the Wing
> SourceAssistant
> - eg: A way to tell Wing what return value a function is (or "is like",
> if we want to stick with python ducks and avoid people telling me to
> switch to a statically typed language!)
> - eg: teaching code in comments like:
>        "#~Wingdef:os.listdir returns list"

Yes, it would be helpful to be able to declare what type the return 
value is and to be able to do it without modifying the source of the 
function.  I would guess that the syntax used would be based on Python 
3's function annotations.

Note that Wing should already know that os.listdir() returns a list, 
though it doesn't know that it's a list of strings.  Tracking the types 
of items in lists, tuples, dictionaries, etc is a separate issue that 
also needs work.

Cheers,

John


More information about the wingide-users mailing list