Simplified the implementation of structures.TimeoutQueue.

This commit is contained in:
Jeremy Fincher 2005-03-09 07:28:09 +00:00
parent b39eaa7cb5
commit ecca13ec11

View File

@ -347,10 +347,8 @@ class TimeoutQueue(object):
def __len__(self):
# No dependency on utils.iter
# return ilen(self)
i = 0
for _ in self:
i += 1
return i
self._clearOldElements()
return len(self.queue)
class MaxLengthQueue(queue):
__slots__ = ('length',)