Guido van Rossum <gu...@python.org> added the comment:
If you want this to work you have to pass the namespace where B is defined as locals to get_type_hint(). The recommended approach is to make B a global class; where that is not possible (as in your second example) you should chose a different name. We're not going to guess additional namespaces to add to the lookup, so I will close this as won't fix. PS. For short code snippets like your examples, I prefer pasting the code inline. ---------- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com