<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Anand,</blockquote><div> This is what I exactly mean. This is the thing I want to do. I am now using python 2.5.1 . So is <br>
there a way that I can do a thing like this in python 2.5.1 ( an alternative way).<br><br> Heshan Suriyaarachchi <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
>>> def f(x : "an integer", y: "another integer") -> "Sum of x and y":<br>
... return x + y<br>
>>> f.__annotations__<br>
{'y': 'another integer', 'x': 'an integer', 'return': 'Sum of x and y'}<br>
<br>
The help() function returns the annotation plus the docstring now.<br>
>>> f.__doc__ = "A sum function"<br>
>>> help(f)<br>
Help on function f in module __main__:<br>
<br>
f(x: 'an integer', y: 'another integer') -> 'Sum of x and y'<br>
A sum function<br>
<br><br>
<div><div></div><div class="Wj3C7c"><br>
</div></div></blockquote></div><br>