Batuhan Taskaya <[email protected]> added the comment:
It is not actually much of a difference;
$ cat t.py
def func(
arg: typing.Callable[
[int, str],
str # test
]
):
pass
import typing
print("Annotations: ", func.__annotations__)
print("get_type_hints: ", typing.get_type_hints(func))
$ ./python t.py
Annotations: {'arg': 'typing.Callable[[int,str],str]'}
get_type_hints: {'arg': typing.Callable[[int, str], str]}
$ ./python
>>> foo: (List[List[List[int, str, bytes]], List[(int, str)]])
>>> __annotations__
{'foo': 'List[List[List[int,str,bytes]],List[(int,str)]]'}
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41967>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com