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

@ -223,6 +223,13 @@ class MaxLengthQueue(queue):
def __init__(self, length, *args):
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: