Save a lot of memory with __slots__ and generators