Define class with itself as generic implementation. Why/how does this work?

NoSuchKey