The problem is like this:
class A():
def foo() -> B:
pass
class B():
def bar() -> A:
pass
This will raise a NameError: name 'B' is not defined
.
For the sake of type checking, I'm not willing to change -> B
to -> "B"
. Is there any workaround?