Message401799
Apparently static checkers like mypy doesn't rely on the `typing.get_type_hints` function to implement its type checking functions (as I had browsed through the code repo).
$ cat test.py
def foo(arg) -> ' str': ...
$ mypy test.py
Success: no issues found in 1 source file
If type checkers *think* this is acceptable, but the standard library doesn't, this can be some sort of inconsistency in my perspective.
As Saiyang Gou had suggested, I would rather prefer to change the behaviour of `compile` in `eval` mode to preserve the internal consistency of builtin functions and therefore to eliminate this *buggy* behaviour of `typing.get_type_hints`. |
|
Date |
User |
Action |
Args |
2021-09-14 20:47:26 | jarryshaw | set | recipients:
+ jarryshaw, gvanrossum, levkivskyi, gousaiyang, kj |
2021-09-14 20:47:26 | jarryshaw | set | messageid: <1631652446.56.0.561966739029.issue43893@roundup.psfhosted.org> |
2021-09-14 20:47:26 | jarryshaw | link | issue43893 messages |
2021-09-14 20:47:26 | jarryshaw | create | |
|