[issue39990] help should evaluate forward reference

2020-05-02 Thread Filipe Laíns
Change by Filipe Laíns : -- keywords: +patch pull_requests: +19185 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19874 ___ Python tracker ___

[issue39990] help should evaluate forward reference

2020-05-02 Thread Filipe Laíns
Filipe Laíns added the comment: typing.get_type_hints can be used for this, it resolves the annotation string. >>> def foo(bar: 'int') -> 'bool': pass ... >>> typing.get_type_hints(foo) {'bar': , 'return': } -- nosy: +FFY00 ___ Python tracker

[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) Howeve