Does Python evaluate type hinting of a forward reference?
Consider the following code: class Foo: def bar(self) -> Foo: return Foo() This program will actually crash at runtime if you try running it with Python: when the interpreter sees the definition of bar, the definition of Foo is not yet finished. So, since Foo has not yet been added to the global namespace, we … Read more