[wingide-users] RE: What doc tool do you use?
info at linos.es
Fri Oct 14 07:27:29 MDT 2011
El 05/10/11 21:46, Wing IDE Support escribió:
> On 10/5/11 2:02 PM, Linos wrote:
>> In the meantime can i use .pi files to declare method signatures and variables?
>> if so what syntax do i have to use to declare this:
>> file test.py:
>> class test(object):
>> def __init__(self, par1, par2):
>> var1 = complicated_and_long_func()
> Put a test.pi file in the same directory with (assuming everything is a str for
> purposes of the example):
> class test(object):
> def __init__(self, par1, par2):
> isinstance(var1, str)
> isinstance(par1, str)
> isinstance(par2, str)
> Note that this was implemented primarily for another use case, so this probably
> won't be the recommended way of doing things if we implement support for other
> type hints but it works now. I'm personally not a fan of having multiple files
> for one module.
I have found that using .pi files i can declare name and type of variables not
declared in the same module but from a different part of the program and
autocomplete and type detection works with the .pi file, for example:
var1 = ""
#var2 = ""
var2 = -1
After reanalyze test.py i can use in other parts of the program:
test.var.. (and wing gives me the two options with the correct types.)
Do i have a way to do the same but inside an object? something like:
class test(object): pass
variable = test()
variable.runtime_tuple = ()
and from other code:
I have tried any differentes ways but still i only get autocompleted __class__
and __init__ from the object.
More information about the wingide-users