My question is related with the new Python's type hints. I'm trying to add a type hint in an object's method who has a parameter of the same type of the object, but PyCharm are marking me as error (unresolved reference 'Foo'
). The problem is as follows:
class Foo:
def foo_method(self, other_foo: Foo):
return "Hello World!"
So the question is how to define the type of other_foo
parameter properly. Maybe __class__
is correct?