By adding __getitem__ we accidentally made KeyData iterable. And in fact it behaved as an infinite iterable, so simply calling list(kd) could go into an infinite loop. I ran into this by making a mistake in a DAMNIT context file.
I can imagine we might want it to be iterable at some point, maybe yielding train IDs or data like .trains(). But for now, avoiding the infinite loop seems like a useful step.
By adding
__getitem__
we accidentally made KeyData iterable. And in fact it behaved as an infinite iterable, so simply callinglist(kd)
could go into an infinite loop. I ran into this by making a mistake in a DAMNIT context file.I can imagine we might want it to be iterable at some point, maybe yielding train IDs or data like
.trains()
. But for now, avoiding the infinite loop seems like a useful step.