mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +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
|
self.length = length
|
||||||
queue.__init__(self, *args)
|
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):
|
def enqueue(self, elt):
|
||||||
if len(self) > self.length:
|
if len(self) > self.length:
|
||||||
self.dequeue()
|
self.dequeue()
|
||||||
|
Loading…
Reference in New Issue
Block a user