[issue39990] help should evaluate forward reference

2020-03-17 Thread Nguyễn Gia Phong
Nguyễn Gia Phong added the comment: I traced it down to inspect.formatannotation(annotation). Before checking for isinstance(annotation, type), IMHO we should do something like import typing if isinstance(annotation, str): annotation = typing.ForwardRef(str)._evaluate(annotation

[issue39990] help output should make use of typing.get_type_hints

2020-03-17 Thread Nguyễn Gia Phong
Change by Nguyễn Gia Phong : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue39990> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39990] help output should make use of typing.get_type_hints

2020-03-17 Thread Nguyễn Gia Phong
New submission from Nguyễn Gia Phong : 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 i

[issue39125] Type signature of @property not shown in help()

2020-01-02 Thread Nguyễn Gia Phong
Change by Nguyễn Gia Phong : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue39125> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39125] Type signature of @property not shown in help()

2019-12-30 Thread Nguyễn Gia Phong
Nguyễn Gia Phong added the comment: Relating to this, should there also be indication about the mode (get, set, del) the property? Currently there is no way to tell if the *attribute* is read-only, read-write or write-only. -- versions: -Python 3.9

[issue39125] Type signature of @property not shown in help()

2019-12-23 Thread Nguyễn Gia Phong
New submission from Nguyễn Gia Phong : 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