[wingide-users] epydoc!

Stephan Deibel sdeibel at wingware.com
Tue Oct 4 08:24:13 MDT 2011


On 10/4/11 2:58 AM, Linos wrote:
> +1 as well, i have read herehttp://epydoc.sourceforge.net/manual-docstring.html
> that with epydoc you can document individual variables inside code, so if wing
> ide add support for this feature we will have all the support we need to type
> annotations using a python standard (epydoc), i think this would be a killer
> feature for Wing IDE given the impossibility of the language to allow a perfect
> type static analysis.

Another thing to consider in this is that in Python 3 you have a 
standard syntax that can be used for type annotations for 
function/method args:

def foo(x:int, y:list):
   pass

The annotation can also be a string:

def foo(x:"something", y:"something else"):
   pass

Or anything:

def foo(x:(int, "something"), y:(list, "something else")):
   pass

Then foo.__annotations__ contains a dict from arg name to the annotation 
value at runtime.  For example for the last one above:

 >>> foo.__annotations__
{'y': (<class 'list'>, 'something else'), 'x': (<class 'int'>, 'something')}

Thought I'd mention it for those that aren't aware of it, although 
looking at this I think maybe putting arg descriptions in the docstring 
like in epydoc is better.  Having simple x:type annotation in the arg 
list is fine and maybe preferable to hiding them in the docstring, but 
adding docs with arg annotations seems hard to read and I don't think 
there's a standard for how to add both -- I just made up using a tuple 
in the above.

- Stephan



More information about the wingide-users mailing list