Message274904
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 |
|
Date |
User |
Action |
Args |
2016-09-07 22:48:27 | David E. Franco G. | set | recipients:
+ David E. Franco G., gvanrossum, levkivskyi, Spencer Brown |
2016-09-07 22:48:27 | David E. Franco G. | set | messageid: <1473288507.2.0.346219489092.issue27989@psf.upfronthosting.co.za> |
2016-09-07 22:48:27 | David E. Franco G. | link | issue27989 messages |
2016-09-07 22:48:27 | David E. Franco G. | create | |
|