>> pass >> >> NameError: name 'Test' is not defined > I think you can fix this by using a string annotation as follows: > > class Test: > def test(self, child: "Test"): > pass Yes, you are right. It is not directly written in the official documentation ( https://docs.python.org/3/library/typing.html ), but it is in the PEP 0484, section "Forward references".
Thanks! Laszlo -- https://mail.python.org/mailman/listinfo/python-list