[wingide-users] Silly question about the parameters
Wing IDE Support
support at wingware.com
Mon Mar 7 09:38:10 MST 2011
On 3/7/11 3:15 AM, Cesco wrote:
>
> Il giorno 02/mar/2011, alle ore 18.31, Wingware Support ha scritto:
>> Yes, just write this:
>>
>> def getHour(mydate):
>> isinstance(mydate, datetime.datetime)
>> mydate.<- will show completions for datetime.datetime instance
>>
>> Wing's static analysis and type inferencing engine sees and understands this kind of use of isinstance in your code so you do not need to be debugging to get the completions.
>
>
> And what if I have to pass a list of objects to a function?
There isn't a way to do this because Wing doesn't track the types of
list items currently. We plan to add this in a future release.
You can extract an item to a variable and add a hint for the variable to
get autocompletion at point of use, e.g.:
x = lst[1]
assert isinstance(x, myClass)
Cheers,
John
More information about the wingide-users
mailing list