mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Forgot stupid __getstate__ and __setstate__.
This commit is contained in:
parent
c19bae2b34
commit
595821f6fd
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user