[issue43817] Add inspect.get_annotations()

Inada Naoki report at bugs.python.org
Mon Apr 26 20:56:37 EDT 2021


Inada Naoki <songofacandy at gmail.com> added the comment:

> Just to be clear: I would *not* want this new mode to be the *default* behavior.  So far I think ONLY_IF_STRINGIZED is the best compromise for default behavior.

I don't think ONLY_IF_STRINGIZED is the best compromise. I don't think it solve any issue.

```
if False:
    from typing import List

def f1() -> 'List[str]':
    pass

def f2(a:int) -> 'List[str]':
    pass
```

In this example, both of help(f1) and help(f2) must show signature, not raise an error.

----------

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


More information about the Python-bugs-list mailing list