[New-bugs-announce] [issue39990] help output should make use of typing.get_type_hints

Nguyễn Gia Phong report at bugs.python.org
Tue Mar 17 05:21:34 EDT 2020


New submission from Nguyễn Gia Phong <vn.mcsinyx at gmail.com>:

With PEP 563, it is legal to annotate a function as follows

def foo(bar: 'int') -> 'bool': pass

Currently, help(foo) would print the exact signature in foo.__annotations__ and it's not really pretty.  My proposal is to use the type hints from typing.get_type_hints to make documentations more readable from the user's perspective.  I might not be aware of all use cases and disadvantages of this proposal however.

----------
assignee: docs at python
components: Documentation
messages: 364399
nosy: McSinyx, docs at python
priority: normal
severity: normal
status: open
title: help output should make use of typing.get_type_hints

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39990>
_______________________________________


More information about the New-bugs-announce mailing list