(self)
| 49 | return ret |
| 50 | |
| 51 | def popleft(self): |
| 52 | if self.is_empty(): |
| 53 | raise IndexError() |
| 54 | ret = self.buf[self.head] |
| 55 | self.head += 1 |
| 56 | self.head %= self.length |
| 57 | return ret |
| 58 | |
| 59 | def __len__(self): |
| 60 | return (self.tail - self.head) % self.length |