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 Fabian.M
Recipients Fabian.M
Date 2021-01-04.16:55:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609779318.04.0.39059957238.issue42824@roundup.psfhosted.org>
In-reply-to
Content
The following code throws with "NameError: name 'Nested' is not defined".

For reference, it works well when moving class definitions out of the local scope.


import typing
T = typing.TypeVar('T')

def test():
    class Nested(typing.Generic[T]):
        pass

    class Test(typing.Generic[T]):
      nested: Nested[T]

    typing.get_type_hints(Test) # this throws

test()
History
Date User Action Args
2021-01-04 16:55:18Fabian.Msetrecipients: + Fabian.M
2021-01-04 16:55:18Fabian.Msetmessageid: <1609779318.04.0.39059957238.issue42824@roundup.psfhosted.org>
2021-01-04 16:55:18Fabian.Mlinkissue42824 messages
2021-01-04 16:55:17Fabian.Mcreate