>>> queue = LinkedQueue() >>> for i in range(1, 6): ... queue.put(i) >>> len(queue) 5 >>> for i in range(1, 6): ... assert len(queue) == 6 - i ... _ = queue.get() >>> len(queue) 0
(self)
| 53 | node = node.next |
| 54 | |
| 55 | def __len__(self) -> int: |
| 56 | """ |
| 57 | >>> queue = LinkedQueue() |
| 58 | >>> for i in range(1, 6): |
| 59 | ... queue.put(i) |
| 60 | >>> len(queue) |
| 61 | 5 |
| 62 | >>> for i in range(1, 6): |
| 63 | ... assert len(queue) == 6 - i |
| 64 | ... _ = queue.get() |
| 65 | >>> len(queue) |
| 66 | 0 |
| 67 | """ |
| 68 | return len(tuple(iter(self))) |
| 69 | |
| 70 | def __str__(self) -> str: |
| 71 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected