Forgot stupid __getstate__ and __setstate__.

This commit is contained in:
Jeremy Fincher 2003-04-09 18:16:39 +00:00
parent c19bae2b34
commit 595821f6fd

View File

@ -224,6 +224,13 @@ class MaxLengthQueue(queue):
self.length = length
queue.__init__(self, *args)
def __getstate__(self):
return (self.length, queue.__getstate__(self))
def __setstate__(self, (length, q)):
self.length = length
queue.__getstate__(self, q)
def enqueue(self, elt):
if len(self) > self.length:
self.dequeue()