Maximilian Hils <python-b...@maximilianhils.com> added the comment:
@Guido van Rossum: Yes, GH-27017 is the same as #41249 in the initial post. There are also some cases where we don't even have a ForwardRef though: foo.py: ``` import typing FooType: typing.TypeAlias = "Foo" class Foo: pass ``` bar.py: ``` import typing import foo def func3(x: foo.FooType): pass print(typing.get_type_hints(func3)) # NameError: name 'Foo' is not defined. ``` In this example, `FooType` is just a regular str (with unknown origin). That's a case where get_type_hints just needs to give up? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44926> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com