Skip to content

behavior with the help function #279

@copperfield42

Description

@copperfield42

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions