<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 20, 2015 at 6:57 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote: <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""></span>
My particular interest here is adding type information to the signature information already displayed in Idle calltips. It would be nice if the typing module (eventually) had a function to do that. It could be used by help(function) also. The point is to help people write correct calls in the first place, by providing easily accessed information, rather than wait for a checker or the runtime to find the error.<br></blockquote></div><br></div><div class="gmail_extra">That is indeed part of the plan. In first approximation, the repr() of an annotation (if it is one of the classes defined in typing.py, such as Union, Callable, or classes derived from Generic[...]) will be usable to describe the type. E.g. the repr() of Tuple[int, str] is exactly 'Tuple[int, str]'. (This works today in my prototype at <a href="https://github.com/ambv/typehinting/tree/master/prototyping">https://github.com/ambv/typehinting/tree/master/prototyping</a> .)<br><br>There are some issues around forward references (not yet implemented) which mean that you probably have to use a simple helper function defined in typing.py to get the annotation, but it should be pretty smooth sailing.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)</div>
</div></div>