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 McSinyx
Recipients McSinyx, docs@python
Date 2019-12-23.15:40:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Dear Maintainer,

I want to request a feature on the generative documentation of type-hinting.
As of December 2019, I believe there is no support for generating such
information in help().  For demonstration, I have this tiny piece of code

class Foo:
    def bar(self) -> int: return 42

    def bar(self, value: int) -> None: pass

    def baz(self, arg: float) -> str: pass

whose documentation on CPython 3.7.5 (on Debian testing amd64 if that matters)
is generated as

class Foo(builtins.object)
 |  Methods defined here:
 |  baz(self, arg: float) -> str
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  bar

I expect the documentation for bar to be as informative as bar, i.e. something
similar to ``bar: int''.  As pointed out by ChrisWarrick on freenode#python,
the annotations are already present, yet help() is not making use of them:

{'return': <class 'int'>}
{'value': <class 'int'>, 'return': None}

Have a Merry Christmas or other holiday of your choice,
Nguyễn Gia Phong
Date User Action Args
2019-12-23 15:40:00McSinyxsetrecipients: + McSinyx, docs@python
2019-12-23 15:40:00McSinyxsetmessageid: <>
2019-12-23 15:40:00McSinyxlinkissue39125 messages
2019-12-23 15:40:00McSinyxcreate