[wingide-users] Silly question about the parameters

Cesco dev at cesco.it
Wed Mar 2 09:51:23 MST 2011


I know that this question might sound silly to many of you skilled WingIDE developers, but I can't understand if there's a workaround for this problem:

Let's suppose that I'm writing this function in python with WingIDE, passing a datetime.datetime instance :

import datetime

def getHour(mydate):
	...

d = datetime.datetime(1974, 7, 10, 8, 30, 0)
hh = getHour(d)

Now if I move the cursor inside the "getHour" function and I write "mydate", inside the source assistant I can see 

"Symbol: mydate
Cannot determine type"

And that's right, because WingIDE cannot tell by itself if a given parameter is a date, a string or anything else (until you run this code of course). So I cannot use the code-intelligence feature to see all the method and the properties of this instance of datetime

In Java, C#, VB.Net or any other language you don't have this problem, because (AFAIK... don't kill me if'm mistaken :) they're strongly-typed languages, so for example you can write:

public int getHour(DateTime mydate) {
	...
}

And the IDE knows that when you refer to "mydate" you're referring to a "DateTime" instance, so it will show you all the properties and the methods available to that class.


Is there a way to declare in WingIDE that a certain parameter used in a function is an instance of something, in order to have the code intelligence working?

Something like telling WingIDE: "hey, you know... inside this function I'm using a parameter called mydate and I'd really like that you would treat it as a datetime instance"


Thank you


More information about the wingide-users mailing list