persistent deque (continued)

Raymond Hettinger python at rcn.com
Mon Jul 21 18:20:39 EDT 2008


On Jul 21, 12:08 pm, castironpi <castiro... at gmail.com> wrote:
> Some time ago, I was asking about the feasibility of a persistent
> deque, a double-ended queue.
>
> It runs into the typical space allocation problems.  

Try starting with a dict-based implementation of a double-ended queue
( http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259179 )
and then replace the dict with a shelf.  Presto, you've got a
persistent deque.

Raymond



More information about the Python-list mailing list