Rotate the items of the Queue `rotation` times >>> queue = QueueByList([10, 20, 30, 40]) >>> queue Queue((10, 20, 30, 40)) >>> queue.rotate(1) >>> queue Queue((20, 30, 40, 10)) >>> queue.rotate(2) >>> queue Queue((40, 10, 20, 3
(self, rotation: int)
| 96 | return self.entries.pop(0) |
| 97 | |
| 98 | def rotate(self, rotation: int) -> None: |
| 99 | """Rotate the items of the Queue `rotation` times |
| 100 | |
| 101 | >>> queue = QueueByList([10, 20, 30, 40]) |
| 102 | >>> queue |
| 103 | Queue((10, 20, 30, 40)) |
| 104 | >>> queue.rotate(1) |
| 105 | >>> queue |
| 106 | Queue((20, 30, 40, 10)) |
| 107 | >>> queue.rotate(2) |
| 108 | >>> queue |
| 109 | Queue((40, 10, 20, 30)) |
| 110 | """ |
| 111 | |
| 112 | put = self.entries.append |
| 113 | get = self.entries.pop |
| 114 | |
| 115 | for _ in range(rotation): |
| 116 | put(get(0)) |
| 117 | |
| 118 | def get_front(self) -> T: |
| 119 | """Get the front item from the Queue |
nothing calls this directly
no outgoing calls
no test coverage detected