mypy (v.1.15.0) complains with the following message Access to generic instance variables via class is ambiguous for the following code: from typing import Self class A: B: Self A.B = A() If I remove B: Self, then is says "type[A]" has no attribute "B". How make mypy happy? You can play with this here: mypy playground Continue reading...