GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — The builtin `help(...)` should unstringify (and "unforwardref") annotations · Issue #101552 · python/cpython Closed Labels DescriptionFeature or enhancementWhen using PitchCurrent behavior displays string annotations with quotes as follows: def foo(x: List["A"], y: "B") -> None: ... help(foo) """ Help on function foo in module ...: foo(x: List[ForwardRef('A')], y: 'B') -> None """ It should be fairly obvious how clunky this is to users, and that the desirable behavior should be something like: help(foo) """ Help on function foo in module ...: foo(x: List[A], y: B) -> None """ #84171 is related, but whereas the suggestion there is to actually evaluate the annotations using This means that the resulting documentation may not be 100% accurate but will not require evaluating the annotation, which can avoid issues such as annotations which cannot be evaluated for some reason. For example: import typing if typing.TYPE_CHECKING: import numpy as np def foo(x: "np.ndarray") -> None: ... help(foo) """ Help on function foo in module ...: foo(x: np.ndarray) -> None """ Note that the There are also some additional edge cases to consider, such as Linked PRsReacted by Benjamin Kirkbride Activity
MetadataMetadataAssigneesLabelsProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |