This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author David E. Franco G.
Recipients David E. Franco G., Spencer Brown, gvanrossum, levkivskyi
Date 2016-09-07.22:48:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473288507.2.0.346219489092.issue27989@psf.upfronthosting.co.za>
In-reply-to
Content
I think that removing the "typing." is for the best, with the example above 

>>> help(foo)
Help on function foo in module __main__:

foo(data:typing.List[typing.Any]) -> typing.Iterator[typing.Tuple[int, typing.Any]]

>>> 


leaving the "typing." produce result that I think are ugly and distracting, not only that, is unnecessary long to convey the same information that can be in a more neat way without it, and more so while more complicated/long the signature is. 

just compare the above with this

>>> help(foo)
Help on function foo in module __main__:

foo(data:List[Any]) -> Iterator[Tuple[int, Any]]:

>>> 

which is a clear winner to me.

Or perhaps alongside modifying inspect.formatannotation also change the __repr__ in typing to exclude the `typing.` or like with for instance TypeVar produce a repr that include some marker instead, like ~ and in that way indicate that one is using typing object resulting in something like this

>>> help(foo)
Help on function foo in module __main__:

foo(data:~List[Any]) -> ~Iterator[~Tuple[int, ~Any]]:

>>> 

which is a little weird but still neat
History
Date User Action Args
2016-09-07 22:48:27David E. Franco G.setrecipients: + David E. Franco G., gvanrossum, levkivskyi, Spencer Brown
2016-09-07 22:48:27David E. Franco G.setmessageid: <1473288507.2.0.346219489092.issue27989@psf.upfronthosting.co.za>
2016-09-07 22:48:27David E. Franco G.linkissue27989 messages
2016-09-07 22:48:27David E. Franco G.create