I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture =P) and I was using a dict to store the lengths of the chains I had alread
With a little bit of thought it seems like you could get the shelve module to do what you want.