Code completion for function's arguments

Aug 23, 2011 at 7:15 PM

Hi,

Is there a way to specify the type (for completion) of function's arguments ?

For example if I have the following function:

 

def myFunc(arg1,arg2):

...

 

Is it possible to have the code completion working for arg1 and arg2 by specifying the type somewhere?

 

Thanks.

Editor
Aug 23, 2011 at 11:33 PM
Edited Aug 23, 2011 at 11:33 PM

There's no declarative way to do it, though we do have a feature open which you can vote on: http://pytools.codeplex.com/workitem/49

If you make a call to myFunc, say myFunc(1, "hello"), the analysis engine will figure out that arg1 is int and arg2 is str. Similarly if you do:

 

foo = MyClass()
bar = MyOtherClass()

myFunc(foo, bar)

then the analyzer will know that arg1 is MyClass and arg2 is MyOtherClass.  It gets less useful when you make calls with inconsistent types though.