This could be list(s for s in self._probs) or list(self._probs.keys()); "list" is for Python 3.x