Jarry Shaw <jarrys...@icloud.com> added the comment:

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`.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43893>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to