In python 3.10 I want to define two classes in the same file where one of the methods of each class has to type hint to the other(code follows).
class Foo:
def some_method(arg: Bar):
return 'Hello'
class Bar:
def some_method(arg: Foo):
return 'World'
Since one has to be defined first the hint is not allowed since the other type has not yet been defined. How can I solve or go around this issue?