It might be fun to expose this with the sequence API: `__len__`, `__iter__`, etc. so you can just write `for key, penalty in dist:` as if it were a dictionary.