You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like the idea of type hint provided by this module, and I would like to use it more often but what stop me for doing so is the lost of information in the automatically generate documentation for the function I annotate using this module, take this for example
from typing import Iterator
def fib() -> Iterator[int]:
"""A generator of blah blah"""
...
when calling help in that function (or the little hint that pop up in the idle) I get the following
>>> help(fib)
Help on function fib in module __main__:
fib() -> typing.Iterator
A generator of blah blah
>>>
as you can see I lost information about fib as I clearly annotate it a iterator of int but that is not reflected in the help in any way as all the internal structure/details that I put in the annotations are lost. The same apply for all the others members of typing
So I would like to get from the above example the following output
>>> help(fib)
Help on function fib in module __main__:
fib() -> Iterator[int]
A generator of blah blah
>>>
which is more helpful and with just a glance I know what I am getting or need from/for the function.
The text was updated successfully, but these errors were encountered:
Thanks for the bug report! This turns out to be a bug in Python's inspect module. E.g. signature(fib) returns the same incomplete signature. It's also possible that the help() function needs to be modified to support this. Can you report the bug at bugs.python.org?
I like the idea of type hint provided by this module, and I would like to use it more often but what stop me for doing so is the lost of information in the automatically generate documentation for the function I annotate using this module, take this for example
when calling
help
in that function (or the little hint that pop up in the idle) I get the followingas you can see I lost information about
fib
as I clearly annotate it a iterator of int but that is not reflected in the help in any way as all the internal structure/details that I put in the annotations are lost. The same apply for all the others members of typingSo I would like to get from the above example the following output
which is more helpful and with just a glance I know what I am getting or need from/for the function.
The text was updated successfully, but these errors were encountered: