This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BTaskaya
Recipients BTaskaya, gvanrossum, lukasz.langa, lys.nikolaou, pablogsal
Date 2020-10-07.19:42:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602099748.05.0.299700437279.issue41967@roundup.psfhosted.org>
In-reply-to
Content
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)]]'}
History
Date User Action Args
2020-10-07 19:42:28BTaskayasetrecipients: + BTaskaya, gvanrossum, lukasz.langa, lys.nikolaou, pablogsal
2020-10-07 19:42:28BTaskayasetmessageid: <1602099748.05.0.299700437279.issue41967@roundup.psfhosted.org>
2020-10-07 19:42:28BTaskayalinkissue41967 messages
2020-10-07 19:42:28BTaskayacreate